Minimal repro: https://github.com/srmagura/graphql-repro
The project was created with:
npm create-vite@latest graphql-repro
Then I chose "Vanilla" and "TypeScript" at the prompts.
Install the graphql npm package and add the import
import * as graphql from "graphql";
It produces an error like:
Uncaught SyntaxError: Unexpected string (at graphql.js?v=4b27e75c:1248:113)
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.
Minimal repro: https://github.com/srmagura/graphql-repro
The project was created with:
Then I chose "Vanilla" and "TypeScript" at the prompts.
Install the
graphqlnpm 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_ENVhas been replaced with "development".Let me know if you think this is a Vite issue instead, and I will report it there.