You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm getting a "TypeError: this.inputElement is null" error when using vue-simple-suggest on custom inputs and using Webpack's lazy loading globally (in "eager" mode) with prefetch disabled.
The bug occurs only the first time a view component is used (because of lazy loading), further instances seem to work correctly.
Hi,
I'm getting a
"TypeError: this.inputElement is null"
error when using vue-simple-suggest on custom inputs and using Webpack's lazy loading globally (in "eager" mode) with prefetch disabled.The bug occurs only the first time a view component is used (because of lazy loading), further instances seem to work correctly.
The problem is (somehow) also described here: https://forum.vuejs.org/t/not-getting-refs-in-mounted/12490
The root cause is that
$refs
is not always available in themounted
lifecycle hook.I've created a projet to easily reproduce this issue (see the README.md file of the project for more details) :
https://github.com/tbl0605/vue-bug-simple-suggest
So basically this bug appears (for me) when:
vue.config.js
Workaround:
I've patched the
mounted
method invue-simple-suggest.vue
to delay initialization to be done after the first component rendering:Maybe it can be done otherwise, but in my case, it works well ;)
The text was updated successfully, but these errors were encountered: