evanw / evanw/esbuild

[Bug] Cannot resolve npm package on macOS

Open
#3,973 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
40.1k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

Esbuild seems to fail to resolve [`vike-react/config`](https://github.com/vikejs/vike-react/blob/d74324b668eb569af355fba7f8c044be7ffb9451/packages/vike-react/package.json#L24) 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

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running the reproduction in brillout/esbuild-bug-macos-resolve on macOS 14.3.1, then inspect the linked vike-react package.json entry for vike-react/config and its ./dist/+config.js target. Done means esbuild resolves that package consistently on the affected macOS setup, with the behavior verified against the reproduction.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, javascript, macos, node.js
Domain
build-system, operating-systems, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.