haoqunjiang / vite-plugin-node-stdlib-browser

Configure `node-stdlib-browser` for Vite projects.
MIT License
79 stars 6 forks source link

no such file or directory, open 'node_modules\node-stdlib-browser\cjs\mock\empty.js\promises' #8

Open develowper opened 1 year ago

develowper commented 1 year ago

hi sodatea. i have a problem with vite and your plugin and web browser automation drives (like puppeteer and webdriverio)

this packages need libraries like fs and i used your plugin for support them. when i just import packages ( import puppeteer from "puppeteer" or import "webdriverio"; )

and use "npm run build" . i get this error:

[vite:load-fallback] Could not load D:_laravelProjects\dabeladl\node_modules\node-stdlib-browser\cjs\mock\empty.js/promises (imported by node_modules/puppeteer-core/lib/esm/puppeteer/node/ChromeLauncher.js): ENOENT: no such file or directory, open 'D:_laravelProjects\dabeladl\node_modules\node-stdlib-browser\cjs\mock\empty.js\promises'

fjuren commented 1 month ago

I'm getting a similar error when running npm run build remix vite:build.

[[commonjs--resolver] Could not load C:\Websites\MyProject\node_modules\node-stdlib-browser\esm\mock\empty.js/promises: ENOENT: no such file or directory, open 'C:\Coding\Websites\MyProject\node_modules\node-stdlib-browser\esm\mock\empty.js\promises'.

Using vite 5.0.0, and it's a dependency of vite-plugin-node-polyfills.