You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a plugin uses build.resolve() to invoke default resolving behavior and esbuild decides that the path is disabled by "browser" in package.json, the answer returned to the plugin does not include any indication that the path is supposed to be disabled. The plugin sees a successful resolution, with an only-partially-resolved filename in the result (which can be missing its extension).
If the plugin decide to leave this resolution result unchanged, esbuild will error while trying to load the incorrect path. The fact that this path was supposed to be disabled has been lost.
[~/hacking/bug-repro2]$ pnpm build [main]
> esbuild-bug@1.0.0 build /Users/edward/hacking/bug-repro2
> node ./build.js
✘ [ERROR] Could not read from file: /Users/edward/hacking/bug-repro2/browser-disabled
demo.js:1:19:
1 │ import * as p from "./browser-disabled";
╵ ~~~~~~~~~~~~~~~~~~~~
/Users/edward/hacking/bug-repro2/node_modules/.pnpm/esbuild@0.24.0/node_modules/esbuild/lib/main.js:1476
let error = new Error(text);
^
Error: Build failed with 1 error:
demo.js:1:19: ERROR: Could not read from file: /Users/edward/hacking/bug-repro2/browser-disabled
The text was updated successfully, but these errors were encountered:
If a plugin uses
build.resolve()
to invoke default resolving behavior and esbuild decides that the path is disabled by "browser" in package.json, the answer returned to the plugin does not include any indication that the path is supposed to be disabled. The plugin sees a successful resolution, with an only-partially-resolved filename in the result (which can be missing its extension).If the plugin decide to leave this resolution result unchanged, esbuild will error while trying to load the incorrect path. The fact that this path was supposed to be disabled has been lost.
Here is a tiny reproduction: https://github.com/ef4/esbuild-bug-repro which produces:
The text was updated successfully, but these errors were encountered: