We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
"vite-plugin-node-polyfills/shims/process/dist/index.js"
"env"
I'm facing this error:
✘ [ERROR] No matching export in "node_modules/vite-plugin-node-polyfills/shims/process/dist/index.js" for import "env" node_modules/.pnpm/[email protected]/node_modules/is-in-ci/index.js:1:8: 1 │ import {env} from 'node:process'; ╵ ~~~ ✘ [ERROR] No matching export in "node_modules/vite-plugin-node-polyfills/shims/process/dist/index.js" for import "cwd" node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/ink/build/components/ErrorOverview.js:2:9: 2 │ import { cwd } from 'node:process';
I can fix this by adding:
export const cwd = process.cwd;
The text was updated successfully, but these errors were encountered:
For now, I've solved this by setting this in my vite config:
config.plugins.push( nodePolyfills({ globals: { process: false, }, overrides: { process: require.resolve('../mocks/node-process.ts'), module: require.resolve('../mocks/node-module.ts'), util: require.resolve('../mocks/node-util.ts'), stream: require.resolve('stream-browserify'), buffer: require.resolve('buffer/'), assert: require.resolve('assert/'), os: require.resolve('os-browserify/browser'), tty: require.resolve('tty-browserify'), }, }), topLevelAwait() );
And this is my mock:
export * from 'vite-plugin-node-polyfills/shims/process'; import process from 'vite-plugin-node-polyfills/shims/process'; export default process; export const cwd = () => '/'; export const env = {};
I had to disable globals.process in order for it to accept the overrides.process.
globals.process
overrides.process
FYI, I'm doing something rather niche/experimental, so don't worry if this doesn't get fixed.
Sorry, something went wrong.
No branches or pull requests
Summary
I'm facing this error:
I can fix this by adding:
The text was updated successfully, but these errors were encountered: