Giter VIP home page Giter VIP logo

Comments (6)

davidmyersdev avatar davidmyersdev commented on May 25, 2024 1

I think adding support for subpath matching should solve this issue. It's now on my todo list.

from vite-plugin-node-polyfills.

thevalo avatar thevalo commented on May 25, 2024

I've got the same problem.

from vite-plugin-node-polyfills.

davidmyersdev avatar davidmyersdev commented on May 25, 2024

Could either of you provide a minimal reproduction using StackBlitz or a similar service?

from vite-plugin-node-polyfills.

Edpacca avatar Edpacca commented on May 25, 2024

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'```

from vite-plugin-node-polyfills.

mojanimator avatar mojanimator commented on May 25, 2024

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'))

from vite-plugin-node-polyfills.

davidmyersdev avatar davidmyersdev commented on May 25, 2024

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.

from vite-plugin-node-polyfills.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.