-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
"process is not defined" errors #2723
Comments
I can get around the issue by putting the following in vite.config.js, but this seems like a hack around, rather than a fix:
|
I believe this is a problem caused by |
Closing this now as Vite will not shim node built-ins, in the same way as Webpack 5 has stopped this practice also. The ecosystem will promptly be patched to avoid usage of node builtins. At some point, that project may be adopted by the rollup org. |
Describe the bug
I have switched from Snowpack to Vite. After doing so, "vite build" works fine, but when I load the app in the browser, I see "process is not defined" errors.
These seem to be caused by calls to "process.platform" and "process.version" being made in some node_modules. Specifically, in the fs.realpath and glob packages used by graphql-ruby-client frontend JS lib.
I'm not sure if I'm doing something wrong, or Vite is missing something, or if graphql-ruby-client is at fault.
Reproduction
bundle install
yarn install
yarn vite build -m development
bin/rails s
System Info
Used package manager: yarn
The text was updated successfully, but these errors were encountered: