Closed thisVioletHydra closed 9 months ago
I've got the same problem.
Could either of you provide a minimal reproduction using StackBlitz or a similar service?
I think adding support for subpath matching should solve this issue. It's now on my todo list.
Hi - I encountered a similar issue which I have recreated Here on stacklitz.
npm run dev
or npm run build
to see the error.
[vite-plugin-sveltekit-compile] Could not load /home/projects/vitejs-vite-wp5msv/node_modules/node-stdlib-browser/esm/mock/empty.js/promises (imported by node_modules/path-scurry/dist/mjs/index.js): ENOTDIR: not a directory, open '/home/projects/vitejs-vite-wp5msv/node_modules/node-stdlib-browser/esm/mock/empty.js/promises'
✓ built in 3.51s
error during build:
ENOTDIR: not a directory, open '/home/projects/vitejs-vite-wp5msv/node_modules/node-stdlib-browser/esm/mock/empty.js/promises'```
same issue when useing webdriverio, or puppeteer packages (web driver automation libraries)
just import them
import {remote} from 'webdriverio'
and these are places that vite stuck:
node_modules/webdriverio/build/utils/index.js:1:15: 1 │ import fs from 'node:fs/promises';
node_modules/fetch-blob/streams.cjs:14:40: 14 │ Object.assign(globalThis, require('node:stream/web'))
After looking into this more, I think the best solution is to either use the new overrides
feature (which would allow you to use your own polyfill for fs
) or to externalize the dependency using something like vite-plugin-externalize-deps.
I'm trying to add @xmcl/resourcepack
to a Vite Three.js project and I'm utterly failing. You say to use overrides
or to externalize the dependency but how would I actually do that?