Title: Source map not working for SCSS files · Issue #50308 · angular/angular · GitHub
Open Graph Title: Source map not working for SCSS files · Issue #50308 · angular/angular
X Title: Source map not working for SCSS files · Issue #50308 · angular/angular
Description: Command build, generate, run, serve Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was No response Description When a /* comment */ is placed in the SC...
Open Graph Description: Command build, generate, run, serve Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was No response Description ...
X Description: Command build, generate, run, serve Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was No response Description ...
Opengraph URL: https://github.com/angular/angular/issues/50308
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Source map not working for SCSS files","articleBody":"### Command\r\n\r\nbuild, generate, run, serve\r\n\r\n### Is this a regression?\r\n\r\n- [ ] Yes, this behavior used to work in the previous version\r\n\r\n### The previous version in which this bug was not present was\r\n\r\n_No response_\r\n\r\n### Description\r\n\r\nWhen a /* comment */ is placed in the SCSS, the position of the content generated by webpack (sourcemap) is displayed incorrectly.\r\n\r\nIt is important to point out that after removing the comment, the desired behavior is successfully obtained.\r\n\r\nHowever, I also did a test using the following loaders in the webpack.config.js part: 'style-loader', 'css-loader', 'sass-loader'.\r\nAnd even having the comment, the content was generated correctly.\r\nThat is, it is certainly not a sass-loader or dart-sass problem, it must be something external that is being used in the webpack settings that were provided by angular, or some plugin or something along those lines\r\n\r\n### The problem:\r\n\r\n\r\n### The source code:\r\n\r\n\r\nThis is a problem that I see exists, so I'm reporting on this channel, but not limited to just SCSS comments, as I write SCSS code other related issues happen, which makes it difficult to debug the application.\r\n\r\n### Minimal Reproduction\r\n\r\n1. Create an angular application with SCSS\r\n2. Put the following comment in scss:\r\n```\r\n//MEDIA QUERY MANAGER\r\n\r\n/*\r\n0 - 600: Phone\r\n600 - 900: Tablet portrait\r\n900 - 1200: Tablet landscape\r\n1200 - 1800: Normal styles\r\n1800+ : Big Desktop\r\n1em = 16px\r\nThe smaller device rules always should write below the bigger device rules\r\nFixing Order => Base + Typography >> General Layout + Grid >> Page Layout + Component\r\n*/\r\n```\r\n\r\n3. See the problem happen.\r\n\r\nTo make it easier I also forked the application on stackblitz, link:\r\nhttps://stackblitz.com/edit/node-xn9fdy\r\n\r\ncd angular-tour-of-heroes\r\nnpm run start (or ng serve)\r\n\r\n\r\n\r\n### Exception or Error\r\n\r\n_No response_\r\n\r\n### Your Environment\r\n\r\n```text\r\n_ _ ____ _ ___\r\n / \\ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|\r\n / △ \\ | '_ \\ / _` | | | | |/ _` | '__| | | | | | |\r\n / ___ \\| | | | (_| | |_| | | (_| | | | |___| |___ | |\r\n /_/ \\_\\_| |_|\\__, |\\__,_|_|\\__,_|_| \\____|_____|___|\r\n |___/\r\n \r\n\r\nAngular CLI: 16.0.1\r\nNode: 16.14.2\r\nPackage Manager: npm 7.17.0\r\nOS: linux x64\r\n\r\nAngular: undefined\r\n... \r\n\r\nPackage Version\r\n------------------------------------------------------\r\n@angular-devkit/architect 0.1600.1\r\n@angular-devkit/core 16.0.1\r\n@angular-devkit/schematics 16.0.1\r\n@angular/cli 16.0.1\r\n@schematics/angular 16.0.1\r\n```\r\n\r\n\r\n### Anything else relevant?\r\n\r\nMy package.json:\r\n```\r\n{\r\n \"name\": \"angular-tour-of-heroes\",\r\n \"version\": \"0.0.0\",\r\n \"scripts\": {\r\n \"ng\": \"ng\",\r\n \"start\": \"ng serve\",\r\n \"build\": \"ng build\",\r\n \"watch\": \"ng build --watch --configuration development\",\r\n \"test\": \"ng test\"\r\n },\r\n \"private\": true,\r\n \"dependencies\": {\r\n \"@angular/animations\": \"^16.0.0\",\r\n \"@angular/common\": \"^16.0.0\",\r\n \"@angular/compiler\": \"^16.0.0\",\r\n \"@angular/core\": \"^16.0.0\",\r\n \"@angular/forms\": \"^16.0.0\",\r\n \"@angular/platform-browser\": \"^16.0.0\",\r\n \"@angular/platform-browser-dynamic\": \"^16.0.0\",\r\n \"@angular/router\": \"^16.0.0\",\r\n \"rxjs\": \"~7.8.0\",\r\n \"tslib\": \"^2.3.0\",\r\n \"zone.js\": \"~0.13.0\"\r\n },\r\n \"devDependencies\": {\r\n \"@angular-devkit/build-angular\": \"^16.0.1\",\r\n \"@angular/cli\": \"~16.0.1\",\r\n \"@angular/compiler-cli\": \"^16.0.0\",\r\n \"@types/jasmine\": \"~4.3.0\",\r\n \"jasmine-core\": \"~4.6.0\",\r\n \"karma\": \"~6.4.0\",\r\n \"karma-chrome-launcher\": \"~3.2.0\",\r\n \"karma-coverage\": \"~2.2.0\",\r\n \"karma-jasmine\": \"~5.1.0\",\r\n \"karma-jasmine-html-reporter\": \"~2.0.0\",\r\n \"typescript\": \"~5.0.2\"\r\n }\r\n}\r\n```\r\n\r\nI don't think it's a problem with the Google Chrome browser, or similar, because when viewing the generated source .map it's clearly noticeable that the error is in generating the sourcemap.\r\n\r\nThat is, just import and preview at https://sokra.github.io/source-map-visualization/#custom-choose","author":{"url":"https://github.com/incapdns","@type":"Person","name":"incapdns"},"datePublished":"2023-05-15T01:20:25Z","url":"https://github.com/angular/angular/issues/50308"}
| 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:1aa0b084-7b56-4f4b-e05e-09ed705b6675 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E780:1DCB8C:19B463C:21E53D7:6B014371 |
| html-safe-nonce | bbc3aacd57f4d753f0831018d075e0ad1e1124c0544b07a4ea3f07f1dc066683 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNzgwOjFEQ0I4QzoxOUI0NjNDOjIxRTUzRDc6NkIwMTQzNzEiLCJ2aXNpdG9yX2lkIjoiODY3NjM4NDgxNjUxNTU5NzE2OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 514971a9c6ddcdde67d9b5816915d1ff2fe3701175090f248792dcbfd07485f5 |
| hovercard-subject-tag | issue:1710277843 |
| 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/50308/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7bdc9d91af223f7f71efa5255c025d9bdc501d6989cd6dfde3f067612fd712a0/angular/angular/issues/50308 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7bdc9d91af223f7f71efa5255c025d9bdc501d6989cd6dfde3f067612fd712a0/angular/angular/issues/50308 |
| og:image:alt | Command build, generate, run, serve Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was No response Description ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | incapdns |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width