-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot read property 'instantSearchInstance' of undefined #249
Comments
Could you make this in a sandbox please? I can't debug code without seeing the full setup. |
@Haroenv this is weird, i tried copy my snippet code into codesandbox and it running well (without other setup in main.js, like firebase onAuthStateChanged). The only difference is i made component named "AlgoSearch.vue" then call it inside a views. It error with that reason. I Also tried to copy that code into App.vue directly then it also returning same error |
Sorry, but unfortunately a screenshot can't be debugged. Is the component actually put inside an ais-instant-search? |
Sorry, I tried some different ways, like below:
and my views
|
again, please create this in a sandbox, sorry |
i works in sandbox, but didn't work in my project. thats why i said weird. However the code are same. Updated: |
🤔 that sandbox indeed totally works for me, and the version which is built will have the error. I'm assuming this might be related to minification changing that name which is tried to be requested? |
Sorry, am really noob. What should i do to solve this? |
Sorry, I have no idea what could be causing this @superdiazzz, the only thing I notice is that the variable name is different (shadowing something else) in the prod version, but I wouldn't know how to avoid that. The only thing I could think of to try for you is to take all Vue InstantSearch code and make it part of your source code, maybe minification will happen differently? I've opened a topic on the Vue forum for this: https://forum.vuejs.org/t/vue-3-production-mode-makes-this-undefined/121265, but I recommend you ask for more help in other places as well, as this isn't really related to InstantSearch, but to Vue and |
Thank you for scaling up this issue. I hope there will be good news. |
I followed the intruction like this package project. i am using vue-instantsearch 4.0.0 for vuejs 3
I copied script like below:
But the result is error in console.
Btw, i have same settings in main.js
The text was updated successfully, but these errors were encountered: