-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
i get error after i build ReferenceError: process is not defined #21
Comments
Hey there. 👋 Can you share your Vite config or provide a reproduction for me? |
Hello, I've encountered the same/similar error. My config was the default one, but I've tried to play with the globals properties (disabling process and global) since I only needed to polyfill 'path'. It did not worked either way. import { defineConfig } from 'vite'
import { nodePolyfills } from 'vite-plugin-node-polyfills'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
nodePolyfills({
// To exclude specific polyfills, add them to this list.
exclude: [
'fs', // Excludes the polyfill for `fs` and `node:fs`.
],
// Whether to polyfill specific globals.
globals: {
Buffer: true, // can also be 'build', 'dev', or false
global: true,
process: true,
},
// Whether to polyfill `node:` protocol imports.
protocolImports: true,
}),
],
}) My error was slighly different, it was 'Uncaught TypeError: Cannot read properties of undefined (reading 'isTTY')', from this code (from jest-util): var _default =
!!process.stdout.isTTY && process.env.TERM !== 'dumb' && !_ciInfo().isCI;
exports.default = _default; My context is specific, I am running Mocha tests using WebDriverIO browser runner (which use Vite). I do not have this error when I am not using the plugin. I ended up using |
Hey @isirode. I still need a reproduction in order to debug this. If you can provide a StackBlitz or CodeSandbox example of this error, I should be able to diagnose the issue and get a fix out. |
Hi, sorry, I had forgotten about it since I did not used it in the end, I will try to provide a reproduction when I have time. |
I'm closing this since I cannot reproduce it. Please open a new issue if this is still a problem. |
ReferenceError: process is not defined
The text was updated successfully, but these errors were encountered: