evanw / esbuild

An extremely fast bundler for the web
https://esbuild.github.io/
MIT License
38.19k stars 1.15k forks source link

[Bug] Cannot resolve npm package on macOS #3973

Open brillout opened 4 days ago

brillout commented 4 days ago

Esbuild seems to fail to resolve vike-react/config for some macOS users. The weird thing is that it seems to only happen on macOS and only for some users. Also note that Node.js can resolve vike-react/config just fine even for these macOS users, so it seems to be an esbuild bug.

Note that vike-react/config resolves to the file ./dist/+config.js which contains a + character. Maybe it has something to do with that + character. (I cannot test because I don't have a macOS machine.)

This is fairly critical because it makes Vike unusable. (Although, as a workaround, Vike now falls back to using Node.js if esbuild fails to resolve, but I ain't sure how reliable that workaround is.)

Reproduction: https://github.com/brillout/esbuild-bug-macos-resolve
macOS version: 14.3.1 (see https://github.com/vikejs/vike/issues/1729#issuecomment-2467073087) Original Vike issue: https://github.com/vikejs/vike/issues/1729

hyrious commented 3 days ago

I'm running macOS 15.1 (current latest) and cannot reproduce the bug.

brillout commented 2 days ago

I'm running macOS 15.1 (current latest) and cannot reproduce the bug.

Yea, it happens only for some macOS users. Maybe it depends on macOS's version.