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
Regression: Importing the package fails in a brand new Vite project #3918
Comments
This got us too -- I think the regexp here is not working quite right: https://github.com/vitejs/vite/blob/main/packages/vite/src/node/plugins/clientInjections.ts#L88-L95 . I think this is a bonified vite bug but because both libraries are so popular this error is going to cause a lot of pain. Worth yanking, or changing the transpilation to work fine with vite out of the box? |
Just adding more info - the So |
@srmagura It's an issue with Vite internals, but I added a workaround for it in |
@IvanGoncharov I was having the same problem and it was solved. Thank you. |
i still have the problem, using the |
@IvanGoncharov I believe that the issue is still present, even with your change applied: I believe a more common way of checking whether you are in Node is to do |
Why this happens I wrote in #3925 |
@lemonmade did you change the default configuration of According to the documentation on the delimiters option, the default value for that option should guard against deep property access. Or are you using another bundler and only also mention that rollup plugin?
|
@phryneas thanks for the response. I checked again and it appears that this issue only affects the development build of Vite, and only up until version 4.2.0. Here's an example showing a slightly older Vite still getting bit by this bug. I can definitely update Vite to fix this for myself, though! On |
Error still present on Quasar Framework with Vite
ETA:
Rolling back to 16.6.0 for now but don't know how long that's gonna fly. |
Same problem here with Quasar + Vite with graphql@16.7.1 |
I tried rolling back to 16.6.0 and I'm still having the same issue with Vite. |
@davidsims9t in that case, maybe clear your vite cache? |
Hitting this using Rollup as well as we're replacing the The fix for me in this case was to add another replace option for graphql in
|
16.5.0 will be fine in my case. |
I had to downgrade all the way down to 15.6.1 for it to work, for me it failed in graphql 16.6.0 with vite , suddenly out of nowhere while i was developing. After that I have not been bale to do anything to restore it, and I ended up having to test previous version, settled at 15.6.1 |
Minimal repro: https://github.com/srmagura/graphql-repro
The project was created with:
Then I chose "Vanilla" and "TypeScript" at the prompts.
Install the
graphql
npm package and add the importIt produces an error like:
If you click on the error in the console, you'll see that
process.env.NODE_ENV
has been replaced with "development".Let me know if you think this is a Vite issue instead, and I will report it there.
The text was updated successfully, but these errors were encountered: