-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError in @ampproject/remapping
with esbuild
0.24.2 +
#200
Comments
I'm so sorry to write here but I just would like to know if the PR will be merged and a new version released in the future. |
@meriturva I suggest you override the esbuild version as described in this comment. It worked for us. |
@griest024 we have just disabled sourcemap generation as a workaround. Override version is not a feasible solution for all the enterprise projects I follow. On the big one project, we are still on Angular v19.0. Thanks! |
@ampproject/remapping
with esbuild
0.24.2@ampproject/remapping
with esbuild
0.24.2 +
The stackblitz is erroring at a different location than the OP's stack trace: const source = rootSources[segment[1]];
traced = originalPositionFor(
source,
segment[2],
segment[3],
segment.length === 5 ? rootNames[segment[4]] : ''
); Here, But this isn't remapping's fault, it's invalid for a source map to reference a 17th (index 16) source and only include 16 sources. From the sourcemap spec 9.a.iii.14:
|
Looking at the the esbuild code, what it's calling "null entries" seem to be 1-length mappings:
If you scan remapping's codebase (or trace-mapping and gen-mapping), you'll see we already handle 1-length mappings. This isn't a new addition to source maps, just a new build tool producing them (Babel and Closure will too).
|
I opened evanw/esbuild#4082 to resolve the bug in esbuild. Patching that and using a local build of esbuild, I can correctly generate the angular project from angular/angular-cli#29465. |
Steps to Reproduce
https://stackblitz.com/edit/stackblitz-starters-xnpd219g?file=index.js
Root Cause
Upon investigation, the issue appears to stem from the upgrade of
esbuild
from0.24.0
to0.24.2
.According to the esbuild changelog, the breaking change was introduced in version

0.24.1
, as shown below:It appears this is an intentional change in
esbuild
, which may require adjustments in@ampproject/remapping
.Expected Behavior
The application should work seamlessly with
esbuild@0.24.2
without encountering aTypeError
.Actual Behavior
The application fails with a
TypeError
in@ampproject/remapping
.Originally posted by @mattlewis92 in #29465
The text was updated successfully, but these errors were encountered: