Closed philippedasilva-orizone closed 3 years ago
hi @philippedasilva-orizone, thanks for choosing the library and taking time to report this issue. 🙏
I proposed a potential fix for the problem you've described. I had to change the import of vue 3's render function, I want to test it before I make a new release though.
In the meantime if you want to make the warning disappear, you could just replace the main.js
in your local node_modules/mdi-vue
folder with the one in the current master branch of this project.
In fact, what you can do until the release isn't out, you could just paste the git repository's uri in the packages.json
of your project. That way you can test the latest changes. If it works for you, please let me know.
I'll get back to you once it's tested and ready to go. 😉
Hi @therufa,
Thanks for the quick reply. I just did what you suggested and both options (simple replacement of the main.js
file or the entire master branch received the same result on my end:
Uncaught ReferenceError: Vue is not defined
at eval (main.js?3048:7)
[...]
I'm falling back to the v2.2.1 release for the time being but I'd be more than happy to help. I believe it is just a matter of safely testing whether Vue is actually defined or not... Or even better, checking at runtime if we are using a version of Vue >= than 3.x
The only way I came up with (which sounds like a hack is using the package.json approach... I'll submit a quick PR for you to check ;)
I made a quick pull request with an approach that prooved to work on my system using either vue js 2 or 3. Let me know if the approach (a little bit "hacky") satisfies your guidelines as I didn't find any on the repository ;)
Since the warning seems to be gone in the latest release, I'm closing this issue. Please reopen in case I missed something.
Environment used:
As per v2.2.1, we can note after a fresh install the following compilation warning on a fresh new install:
This is pointing specifically to the
main.js
file where we can see the current implementation to support both Vue 2.x and Vue 3.x using the same package.Any idea how to prevent that? I'm more than happy to help fixing that but I have no experience dealing with conditional compilation using javascript.