Skip to content
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

fix(bazel): disable angular linker sourcemaps #385

Merged
merged 1 commit into from Feb 4, 2022

Conversation

alan-agius4
Copy link
Collaborator

When using the linker on @angular/material or packages which contain external sourcemap. The sourcemap will contain multiple sources example.

Babel now uses 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

  [
    '/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

Addresses CI failure

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
@alan-agius4
Copy link
Collaborator Author

//cc @JoostK this fixes the issue with esbuild.

@devversion devversion merged commit a90f807 into angular:main Feb 4, 2022
@alan-agius4 alan-agius4 deleted the esbuild-linker branch February 4, 2022 15:54
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Mar 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants