vitejs / vite

Next generation frontend tooling. It's fast!
http://vitejs.dev
MIT License
65.94k stars 5.88k forks source link

[ERR_MODULE_NOT_FOUND] [ESM] Vite doesn't bundle internal dependencies #17500

Open rtritto opened 2 weeks ago

rtritto commented 2 weeks ago

Describe the bug

With ESM, the electron-squirrel-startup dependency can't be found if it's in dependencies (it works if I move it into devDependencies):

I did a try with other dependencies such as react and solid-js.

Stack

Electron Forge + Electron + Vite + ESM + Plug'n'Play (PnP) + Typescript

Reproduction

https://github.com/rtritto/template-electron-vite

Steps to reproduce

System Info

System:
    OS: Windows 11
  Binaries:
    Node: 20.11.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 4.3.0 - C:\Program Files\nodejs\yarn.CMD
    npm: 10.2.4 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium 126
    Internet Explorer: 11

Used Package Manager

yarn

Logs

No response

Validations

rtritto commented 2 weeks ago

FYI @merceyz