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
Uncaught ReferenceError: __DEFINES__ is not defined #19
Comments
back to vite 2.4.3 works |
Worked, a lot thanks |
It's because that the background script imports You can try this workaround: optimizeDeps: {
include: ['vue', '@vueuse/core'],
- exclude: ['vue-demi'],
+ exclude: ['vue-demi', '@vite/client', '@vite/env'],
}, and then delete Vite's cache dir This will be solved in vitejs/vite#4716 |
I met the same problem in another project. I reinstall a different verion of nodejs may cause the problem.I guess the cache does not match the nodejs I used |
Just wanted to contribute a bit here since I ran into the same issue and was able to finally figure it out. It turns out that it was because I had this in my index.html: I had initially updated my vite config file with this solution from above: ` optimizeDeps: {
But this didn't make a difference for me for whatever reason. I decided to instead simply delete the script tag and I was able to get it all to work. The clue for me was this post: vitejs/vite#12344 (comment) I realized that having I don't fully understand why, but I hope this is helpful for anyone else. |
I just clone the template and run 'pnpm i' and 'pnpm dev', and load the extension to chrome, but I get this error
for the backgound script. This error introduced from this file
https://github.com/vitejs/vite/blob/fa30f76e49de0ca8abd96c1fd866da0512ed29b9/packages/vite/src/client/env.ts
I try to use yarn and firefox, same error.
The text was updated successfully, but these errors were encountered: