# Error when creating new instance of new Parse.Query: "Right-hand side of 'instanceof' is not callable"

**URL:** <https://community.parseplatform.org/t/error-when-creating-new-instance-of-new-parse-query-right-hand-side-of-instanceof-is-not-callable/2305>\
**Category:** JavaScript SDK\
**Tags:** query\
**Created:** [December 18, 2021, 12:44pm UTC](https://community.parseplatform.org/t/error-when-creating-new-instance-of-new-parse-query-right-hand-side-of-instanceof-is-not-callable/2305 "2021-12-18T12:44:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![elrumo](https://community.parseplatform.org/user_avatar/community.parseplatform.org/elrumo/32/395_2.png) [@elrumo](https://community.parseplatform.org/u/elrumo)\
**Post date:** [December 18, 2021, 12:45pm UTC](https://community.parseplatform.org/t/error-when-creating-new-instance-of-new-parse-query-right-hand-side-of-instanceof-is-not-callable/2305/1 "2021-12-18T12:45:00Z")

</div>

I’m getting the following error whenever I create a new instance with `new Parse.Query(Icons);`:

```auto
Uncaught (in promise) TypeError: Right-hand side of 'instanceof' is not callable
    at new re (vendor.896abb9e.js:12:10288)

```

The weird thing is that the error only happens when I run the project in produtction, when running in dev it works as expected. I’m using Vue and Vite if it’s of any use. I’ve searched everywhere but I could not find any similar errors, would anyone know why this is happening?

Many thanks in advanced, it’s driving me crazy.

---

<div class="post-metadata">

**Author:** ![davimacedo](https://community.parseplatform.org/user_avatar/community.parseplatform.org/davimacedo/32/316_2.png) [@davimacedo](https://community.parseplatform.org/u/davimacedo)\
**Post date:** [December 20, 2021, 3:28am UTC](https://community.parseplatform.org/t/error-when-creating-new-instance-of-new-parse-query-right-hand-side-of-instanceof-is-not-callable/2305/2 "2021-12-20T03:28:39Z")

</div>

Could you share how you are initializing Icons var and also the complete error stack?

---

<div class="post-metadata">

**Author:** ![elrumo](https://community.parseplatform.org/user_avatar/community.parseplatform.org/elrumo/32/395_2.png) [@elrumo](https://community.parseplatform.org/u/elrumo)\
**Post date:** [December 20, 2021, 5:25pm UTC](https://community.parseplatform.org/t/error-when-creating-new-instance-of-new-parse-query-right-hand-side-of-instanceof-is-not-callable/2305/3 "2021-12-20T17:25:32Z")

</div>

Sure, here is the full error stack:

 ![image_2021-12-20_182122](https://parse-community-forum-uploads.s3.dualstack.us-east-1.amazonaws.com/original/1X/1bc895ce27727e3e1dd21c034127b0cd3b9a53b6.png)

And this is the code that works just fine when in dev (npm run dev / vite), but not when in prod (npm run build / vite build), which is running inside a function called `getIconsArray()` you can see on the error above. It seems the error happens when creating a new instance of `Parse.Query(...)`

 ![image](https://parse-community-forum-uploads.s3.dualstack.us-east-1.amazonaws.com/original/1X/8e16ca3281717b19206780dbef26e6bb2efdc10f.png)

Many thanks and let me know if there’s anything else you’d like.

---

<div class="post-metadata">

**Author:** ![davimacedo](https://community.parseplatform.org/user_avatar/community.parseplatform.org/davimacedo/32/316_2.png) [@davimacedo](https://community.parseplatform.org/u/davimacedo)\
**Post date:** [December 21, 2021, 6:40pm UTC](https://community.parseplatform.org/t/error-when-creating-new-instance-of-new-parse-query-right-hand-side-of-instanceof-is-not-callable/2305/4 "2021-12-21T18:40:08Z")

</div>

It looks an error when building the files. Can you check on this .js file what do you have on that line throwing the error?

---

<div class="post-metadata">

**Author:** ![elrumo](https://community.parseplatform.org/user_avatar/community.parseplatform.org/elrumo/32/395_2.png) [@elrumo](https://community.parseplatform.org/u/elrumo)\
**Post date:** [December 22, 2021, 9:33am UTC](https://community.parseplatform.org/t/error-when-creating-new-instance-of-new-parse-query-right-hand-side-of-instanceof-is-not-callable/2305/5 "2021-12-22T09:33:12Z")

</div>

That would make sense, I think the error started happening when I switched to using Vite, it was working fine when I was using Webpack. Although I have no clue how I could fix this, I’ll also do some reserach around this.

And what file do you mean? The vecndor.js file on the error stack? That’s a compiled JS, but I can share that if you want.

---

<div class="post-metadata">

**Author:** ![elrumo](https://community.parseplatform.org/user_avatar/community.parseplatform.org/elrumo/32/395_2.png) [@elrumo](https://community.parseplatform.org/u/elrumo)\
**Post date:** [December 22, 2021, 10:23am UTC](https://community.parseplatform.org/t/error-when-creating-new-instance-of-new-parse-query-right-hand-side-of-instanceof-is-not-callable/2305/6 "2021-12-22T10:23:46Z")

</div>

Ok, so I seem to have found the solution, importing Parse as  
`import Parse from 'parse/dist/parse.min.js'` instead of `import Parse from 'parse'`.

For some reason the latter worked in the dev build under Vite and with Webpack in all circumstances, but not when running the production build with Vite.

Not sure if it’s a bug or intended behaviour, but it works now. Thanks!

---

<div class="post-metadata">

**Author:** ![dvinubius](https://community.parseplatform.org/user_avatar/community.parseplatform.org/dvinubius/32/1073_2.png) [@dvinubius](https://community.parseplatform.org/u/dvinubius)\
**Post date:** [February 26, 2022, 10:14pm UTC](https://community.parseplatform.org/t/error-when-creating-new-instance-of-new-parse-query-right-hand-side-of-instanceof-is-not-callable/2305/7 "2022-02-26T22:14:51Z")

</div>

I don’t use Parse at all, but in my Vite-React app one of my dependencies was giving me the same issue in the production bundle. Nasty one!  
But your solution helped me solve it, thank you.
