question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Transformation map 0 must have exactly one source file.

See original GitHub issue

🐞 Bug report

Command (mark with an x)

  • build

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


 | ERROR in packages\web-app-edit\node_modules\@angular\cdk\fesm2020\scrolling.mjs
 | Module build failed (from node_modules\babel-loader\lib\index.js):
 | Error: C:\Users\***\repo\oas-web\node_modules\@angular\cdk\fesm2020\scrolling.mjs: Transformation map 0 must have exactly 
one source file.
 | Did you specify these with the most recent transformation maps first?
 |     at buildSourceMapTree (C:\Users\***\repo\oas-web\node_modules\@ampproject\src\build-source-map-tree.ts:33:13)
 |     at remapping (C:\Users\***\repo\oas-web\node_modules\@ampproject\src\remapping.ts:36:17)
 |     at mergeSourceMap (C:\Users\***\repo\oas-web\node_modules\@babel\core\lib\transformation\file\merge-map.js:19:30)     
 |     at generateCode (C:\Users\***\repo\oas-web\node_modules\@babel\core\lib\transformation\file\generate.js:72:39)        
 |     at run (C:\Users\***\repo\oas-web\node_modules\@babel\core\lib\transformation\index.js:55:33)
 |     at run.next (<anonymous>)
 |     at Function.transform (C:\Users\***\repo\oas-web\node_modules\@babel\core\lib\transform.js:25:41)
 |     at transform.next (<anonymous>)
 |     at step (C:\Users\***\repo\oas-web\node_modules\gensync\index.js:261:32)
 |     at C:\Users\***\repo\oas-web\node_modules\gensync\index.js:273:13
 |  @ node_modules\@angular\cdk\fesm2020\overlay.mjs 1:0-45 2:0-57 3:0-88 3:0-88 3:0-88 3:0-88 407:54-73 407:88-104 424:12-31 426:12-28 3043:55-71 3060:12-28 3834:39-54 3834:57-72 3841:42-57 3842:55-70
 |  @ packages\web-app-edit\src\app\common\services\condition-editor.service.ts 4:18-49 30:11-42
 |  @ packages\web-app-edit\src\app\components\common\condition-editor\condition-editor.component.ts 6:35-95 24:11-71
 |  @ packages\web-app-edit\src\app\app.module.ts 17:37-111
 |  @ packages\web-app-edit\src\main.ts 6:21-48

🌍 Your Environment


Angular CLI: 13.2.2
Node: 16.13.2
Package Manager: npm 8.1.2
OS: win32 x64

Angular: 13.2.1
... animations, cdk, common, compiler, compiler-cli, core, forms
... material, platform-browser, platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------     
@angular-devkit/architect         0.1302.2
@angular-devkit/build-optimizer   0.1302.1
@angular-devkit/core              13.2.2
@angular-devkit/schematics        13.2.2
@angular/cli                      13.2.2
@ngtools/webpack                  13.2.2
@schematics/angular               13.2.2
ng-packagr                        13.2.1
rxjs                              7.5.2
typescript                        4.5.5
webpack                           5.67.0

Anything else relevant?

I’m using @ngtools/webpack to build and not the CLI

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
JoostKcommented, Feb 6, 2022

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.

0reactions
angular-automatic-lock-bot[bot]commented, Mar 11, 2022

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Transformation map 0 must have exactly one source file ...
i mean, why must maps 0 to -2 have only one source file? this looks more like 'not implemented' than 'error'. put differently:...
Read more >
Optimization error [scripts.js]: Error: Transformation map 1 ...
... Error: Transformation map 1 must have exactly one source file ... I see the source map on browser but the artifacts are...
Read more >
4 Reasons Why Your Source Maps are Broken - Sentry Blog
To verify your source map directive is present and working, you need to: Locate the sourceMappingURL comment at the very end of the...
Read more >
Source transformation in mapping data flow - Azure
Every data flow requires at least one source transformation, but you can add as many sources as necessary to complete your data transformations....
Read more >
Joining Two Instances of the Same Source
The following figure shows two instances of the same source joined with a Joiner transformation: The mapping contains two sources, ITEMS and ITEMS1, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found