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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transformation map 0 must have exactly one source file. #44972
Comments
I noticed the same issue while upgrading Babel to 7.17 in angular/angular. This is likely due to babel/babel#14209 as that error originates from |
@JoostK Great. I just saw that @alan-agius4 was working on a fix. Do you guys have a workaround for now? No one in our team can build at the moment. |
Revert to Babel 7.16 |
I'll probably have to downgrade @angular in that case since we're not using Babel as a direct dependency. I'll figure it out. |
Isn't the CLI still on Babel 7.16 given that angular/angular-cli#22644 hasn't been merged yet? |
@JoostK |
Yep, we just realized that that would be the one pulling in a newer version of Babel. You can use Yarn resolutions or npm >= 8.3 overrides. |
I have ~20 other packages in the same situation `^7.x.x'. |
This seems to be related to the change in Babel babel/babel#14209 mentioned by @JoostK earlier. What is happing here is that when using the linker on
remapping which is the package used by Babel to merge sourcemaps doesn't support multiple sources. Previously, Babel failed silently and didn't generate a sourcemap #42769 at all. As a workaround you can disable sourcemaps from the linker via the test: /\.mjs$/,
loader: "babel-loader",
options: {
compact: false,
plugins: [
[linkerPlugin.default, { sourceMapping: false }],
],
}, My suggestion would be that for the time being the compiler-cli team flip the default of |
What is happing here is that when using the linker on `@angular/material` the sourcemap will contain multiple sources example. Babel now uses [remapping](https://github.com/ampproject/remapping/) to merge sourcemaps, see: babel/babel#14209. This doesn't support multiple sources which the linker produduces. Previously, Babel failed silently and didn't generate a sourcemap angular/angular#42769 at all. Linker produced sourcemap ```js [ '/packages/web-app-edit/Users/cli-reproductions/monorepo-new/node_modules/@angular/material/fesm2020/card.mjs', '/packages/web-app-edit/Users/src/material/card/card.html', '/packages/web-app-edit/Users/src/material/card/card-header.html', '/packages/web-app-edit/Users/src/material/card/card-title-group.html' ] ``` Will cause the below error during merging ``` Transformation map 0 must have exactly one source file. ``` Related to - angular/angular#42769 - angular/angular#44972 Addresses CI failure - https://app.circleci.com/pipelines/github/angular/angular/42281/workflows/e060088b-5963-43b0-b6fc-b4ddd8855bee/jobs/1116551
When using the linker on `@angular/material` or packages which contain external sourcemap. The sourcemap will contain multiple sources example. Babel now uses [remapping](https://github.com/ampproject/remapping/) to merge sourcemaps, see: babel/babel#14209. This doesn't support multiple sources which the linker produduces. Previously, Babel failed silently and didn't generate a sourcemap angular/angular#42769 at all. Linker produced sourcemap ```js [ '/packages/web-app-edit/Users/cli-reproductions/monorepo-new/node_modules/@angular/material/fesm2020/card.mjs', '/packages/web-app-edit/Users/src/material/card/card.html', '/packages/web-app-edit/Users/src/material/card/card-header.html', '/packages/web-app-edit/Users/src/material/card/card-title-group.html' ] ``` Will cause the below error during merging ``` Transformation map 0 must have exactly one source file. ``` Related to - angular/angular#42769 - angular/angular#44972 Addresses CI failure - https://app.circleci.com/pipelines/github/angular/angular/42281/workflows/e060088b-5963-43b0-b6fc-b4ddd8855bee/jobs/1116551
When using the linker on `@angular/material` or packages which contain external sourcemap. The sourcemap will contain multiple sources example. Babel now uses [remapping](https://github.com/ampproject/remapping/) to merge sourcemaps, see: babel/babel#14209. This doesn't support multiple sources which the linker produduces. Previously, Babel failed silently and didn't generate a sourcemap angular/angular#42769 at all. Linker produced sourcemap ```js [ '/packages/web-app-edit/Users/cli-reproductions/monorepo-new/node_modules/@angular/material/fesm2020/card.mjs', '/packages/web-app-edit/Users/src/material/card/card.html', '/packages/web-app-edit/Users/src/material/card/card-header.html', '/packages/web-app-edit/Users/src/material/card/card-title-group.html' ] ``` Will cause the below error during merging ``` Transformation map 0 must have exactly one source file. ``` Related to - angular/angular#42769 - angular/angular#44972 Addresses CI failure - https://app.circleci.com/pipelines/github/angular/angular/42281/workflows/e060088b-5963-43b0-b6fc-b4ddd8855bee/jobs/1116551
A fix has landed in Babel to avoid the error, and to actually start supporting multiple output sources: babel/babel#14246. Once a new patch release of Babel is out this issue should resolve itself. |
Babel 7.17.2 has been released with the fix. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
馃悶 Bug report
Command (mark with an
x
)Is this a regression?
Yes. I worked before I updated Angular from 13.0.3 -> 13.2.0.
However, the issue didn't appear until AFTER i cleared my node_modules and reinstalled. So it worked fine a few day after updating.
Description
When building our applications we get this error:
Transformation map 0 must have exactly one source file.
It only happens during dev-build, not production.
Worth noting here is that the path on the first line,
packages\web-app-edit\node_modules\@angular
, does not exists.We have all dependencies in the monorepo root.
馃敩 Minimal Reproduction
I have a skeleton of our monorepo in a GitHub repository where I have removed all applications but one. All libs are still there since the app is dependent on them.
https://github.com/JonWallsten/monorepo-new/tree/angular-bug-transformation
馃敟 Exception or Error
馃實 Your Environment
Anything else relevant?
I'm using @ngtools/webpack to build and not the CLI
The text was updated successfully, but these errors were encountered: