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
I was using the 4.0.3 version before but since yesterday it has been reporting an error
The code and module that went wrong have been identified through both projects, but I didn't find out whose dependency this error message is from
qs -> side-channel -> get-intrinsic -> es-errors
jsonwebtoken -> jws -> util
If you use esbuild-loader with the above 2 modules in your project, you get the error
Error: File '@ljharb/tsconfig' not found.
at je (/Users/zhengxs/demo/node_modules/get-tsconfig/dist/index.cjs:3:9102)
at te (/Users/zhengxs/demo/node_modules/get-tsconfig/dist/index.cjs:3:10066)
at ie (/Users/zhengxs/demo/node_modules/get-tsconfig/dist/index.cjs:3:10781)
at Object.$e [as getTsconfig] (/Users/zhengxs/demo/node_modules/get-tsconfig/dist/index.cjs:3:10886)
at Object.ESBuildLoader (/Users/zhengxs/demo/node_modules/esbuild-loader/dist/index.cjs:65:36)
at LOADER_EXECUTION (/Users/zhengxs/demo/node_modules/loader-runner/lib/LoaderRunner.js:132:14)
at runSyncOrAsync (/Users/zhengxs/demo/node_modules/loader-runner/lib/LoaderRunner.js:133:4)
at iterateNormalLoaders (/Users/zhengxs/demo/node_modules/loader-runner/lib/LoaderRunner.js:251:2)
at /Users/zhengxs/demo/node_modules/loader-runner/lib/LoaderRunner.js:224:4
at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3)
ljharb recently updated packages with a tsconfig.json that extends @ljharb/tsconfig
esbuild-loader resolving tsconfig.json on dependency imports (bug)
In the minimal reproduction provided above, it's happening because of set-function-length & hasown. You can grep your node_modules for @ljharb/tsconfig to find which packages are causing this.
While these errors started happening as a result of ljharb publishing these tsconfig.json files (which may be an oversight since it's a dev concern), the bug is in esbuild-loader resolving tsconfig files in dependencies.
Solution
The fix should be simple: resolve tsconfig conditionally if the real path is not in node_modules.
Next steps
I'm happy to accept & review a PR. It should contain a test for this case (fake dependency fixture with tsconfig.json).
Locking thread to direct further conversation to PRs.
Repository owner
locked and limited conversation to collaborators
Mar 14, 2024
Problem
I was using the 4.0.3 version before but since yesterday it has been reporting an error
The code and module that went wrong have been identified through both projects, but I didn't find out whose dependency this error message is from
If you use esbuild-loader with the above 2 modules in your project, you get the error
Expected behavior
Bundle Success
Minimal reproduction URL
https://stackblitz.com/edit/node-gcfggk?file=package.json
Version
v4.0.3
Node.js version
v16.0.0
Package manager
yarn
Operating system
macOS
Contributions
The text was updated successfully, but these errors were encountered: