Skip to content
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

GraphQL 16.7.0 breaks Vue3/Vite3 #3921

Closed
UglyHobbitFeet opened this issue Jun 22, 2023 · 3 comments
Closed

GraphQL 16.7.0 breaks Vue3/Vite3 #3921

UglyHobbitFeet opened this issue Jun 22, 2023 · 3 comments

Comments

@UglyHobbitFeet
Copy link

UglyHobbitFeet commented Jun 22, 2023

When I upgrade my package.json, Vue no longer works as expected. (I get a blank screen instead of rendering my html/divs). Depending on browser console output I get a different error:

Chrome: Error with npm: [vite] Internal server error: Unexpected string

Firefox: Parsing error in the graphql stuff. Missing a )

IvanGoncharov added a commit that referenced this issue Jun 22, 2023
Fixes: #3919 #3920 #3921
Context: #3887 changed code and introced optinal chaining.
`globalThis.process?.env.NODE_ENV` is transpiled into
```
(_globalThis$process = globalThis.process) === null ||
_globalThis$process === void 0
  ? void 0
  : _globalThis$process.env.NODE_ENV;
```
Bundlers incorrectly replace (probably RegExp) `process.env.NODE_ENV` with `"development"` resulting in:
```
(_globalThis$process = globalThis.process) === null ||
_globalThis$process === void 0
  ? void 0
  : _globalThis$"development";
```

Technically it's not a graphql issue but an issue with bundler but since it caused so much pain in comutinity this is an attempt to fix it within our codebase.
@IvanGoncharov
Copy link
Member

@UglyHobbitFeet It's an issue with Vue internals but I added a workaround for it in 16.7.1 Can please confirm that it is fixed?

@UglyHobbitFeet
Copy link
Author

UglyHobbitFeet commented Jun 22, 2023 via email

@IvanGoncharov
Copy link
Member

@UglyHobbitFeet Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants