Title: Sourcemap path in current bundle isn't being formed properly · Issue #14021 · angular/angular · GitHub
Open Graph Title: Sourcemap path in current bundle isn't being formed properly · Issue #14021 · angular/angular
X Title: Sourcemap path in current bundle isn't being formed properly · Issue #14021 · angular/angular
Description: I'm submitting a ... (check one with "x") [ x ] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/...
Open Graph Description: I'm submitting a ... (check one with "x") [ x ] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not submit support reque...
X Description: I'm submitting a ... (check one with "x") [ x ] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not ...
Opengraph URL: https://github.com/angular/angular/issues/14021
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Sourcemap path in current bundle isn't being formed properly","articleBody":"**I'm submitting a ...** (check one with \"x\")\r\n```\r\n[ x ] bug report => search github for a similar issue or PR before submitting\r\n[ ] feature request\r\n[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\r\n```\r\n\r\n**Current behavior**\r\nSourcemaps are being added to each angular bundle from the perspective of the wrong directory. These sourcemaps are currently included in the latest (2.4.4) release when doing a fresh npm install.\r\n\r\nExample from `node_modules/@angular/core/src/linker/compiler.js.map`\r\n\r\n```\r\n{\"version\":3,\"file\":\"compiler.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../modules/@angular/core/src/linker/compiler.ts\"],\"names\":[],\r\n```\r\n\r\nThis is causing an unexpected/incorrect path to be displayed in debugging tools.\r\n\r\n**Expected behavior**\r\nSourcemap paths should start from the npm repository's base directory. In this case the path should start from `modules/@angular/core`\r\n\r\nResulting in a path similar to this:\r\n\r\n```\r\n{\"version\":3,\"file\":\"compiler.js\",\"sourceRoot\":\"\",\"sources\":[\"src/linker/compiler.ts\"],\"names\":[],\r\n\r\n```\r\n\r\n**Minimal reproduction of the problem with instructions**\r\n\r\nCreate a new project with Angular CLI beta.25-5\r\n\r\nmodify the file: node_modules/angular-cli/models/webpack-build-common.js:132\r\n\r\nreplace `exclude: [nodeModules]` with `exclude: /node_modules\\/(?!(\\@angular\\/core)).*/`\r\n\r\n*note: this is just to quickly include sourcemaps for @angular/core\r\n\r\nrun `ng serve`\r\n\r\nOpen the served page in Chrome and use developer tools > Sources tab\r\nAs a result (when using webpack) files appear to be in:\r\n\r\n```\r\nwebpack://../../../../../modules/@angular/core/src/linker/compiler.ts\r\n```\r\n\r\ninstead of \r\n```\r\nwebpack://./~/@angular/core/src/linker/compiler.ts\r\n```\r\n\r\n**What is the motivation / use case for changing the behavior?**\r\nDebugging Angular codebase from the context of a CLI project (I'm assuming whenever using webpack).\r\n\r\n**Please tell us about your environment:**\r\n\u003c!-- Operating system, IDE, package manager, HTTP server, ... -->\r\nOSX, VSCode, NPM, Webpack Dev Sever\r\n\r\n* **Angular version:** 2.0.X\r\n\u003c!-- Check whether this is still an issue in the most recent Angular version -->\r\n2.4.4\r\n\r\n* **Browser:** [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]\r\n\u003c!-- All browsers where this could be reproduced -->\r\n Chrome, I haven't tried others\r\n\r\n* **Language:** [all | TypeScript X.X | ES6/7 | ES5]\r\nTypeScript\r\n\r\n* **Node (for AoT issues):** `node --version` = \r\nangular-cli: 1.0.0-beta.25.5\r\nnode: 6.5.0\r\nos: linux x64\r\n@angular/common: 2.4.4\r\n@angular/compiler: 2.4.4\r\n@angular/core: 2.4.4\r\n@angular/forms: 2.4.4\r\n@angular/http: 2.4.4\r\n@angular/material: 2.0.0-beta.1\r\n@angular/platform-browser: 2.4.4\r\n@angular/platform-browser-dynamic: 2.4.4\r\n@angular/router: 3.4.4\r\n@angular/compiler-cli: 2.4.4\r\n\r\n\r\nAlso note, I believe that webpack may be having issues with the sourcemaps plugin for scoped npm packages (anything @username/project) it's not placing the sources in the correct location even when the sourcemaps are corrected.","author":{"url":"https://github.com/JSMike","@type":"Person","name":"JSMike"},"datePublished":"2017-01-19T22:56:53Z","url":"https://github.com/angular/angular/issues/14021"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cc888817-3fbd-fd56-6f77-7c5aa42038ba |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A53E:19F84C:12F56CD:18458DD:6B010F62 |
| html-safe-nonce | d78f1b8c7b7089129085778062bd12e293063f83bc4655ace219183a855d35d7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNTNFOjE5Rjg0QzoxMkY1NkNEOjE4NDU4REQ6NkIwMTBGNjIiLCJ2aXNpdG9yX2lkIjoiNDQyODA0ODYyMDM5ODM4Mjk0NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8a9491c3da2084d9912ec3dcf1f6fe564e19b9c164b6acd9c42d8c71b5341b2c |
| hovercard-subject-tag | issue:202000281 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/14021/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b808ebbc492d851e54d78b5e2d1a6d904e7139d55513e8e3c31268b4af0e6062/angular/angular/issues/14021 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b808ebbc492d851e54d78b5e2d1a6d904e7139d55513e8e3c31268b4af0e6062/angular/angular/issues/14021 |
| og:image:alt | I'm submitting a ... (check one with "x") [ x ] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not submit support reque... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JSMike |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width