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

CSS urls are broken when using sourcemaps #4273

Closed
filipesilva opened this issue Jan 28, 2017 · 2 comments · Fixed by #4280
Closed

CSS urls are broken when using sourcemaps #4273

filipesilva opened this issue Jan 28, 2017 · 2 comments · Fixed by #4280
Labels
P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful type: bug/fix

Comments

@filipesilva
Copy link
Contributor

Fixing sourcemaps for global css in #4222 introduced a new bug due to webpack-contrib/css-loader#232.

While --sourcemap is enabled (default for dev) and --extract-css is disabled (default for dev), urls in css can become incorrect. See webpack-contrib/css-loader#232 for more details.

Temporary workaround is to serve with either --no-sourcemap or --extract-css.

@filipesilva filipesilva added command: build P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful type: bug/fix labels Jan 28, 2017
@filipesilva filipesilva changed the title CSS urls are broken when using sourcempas CSS urls are broken when using sourcemaps Jan 29, 2017
@filipesilva
Copy link
Contributor Author

filipesilva commented Jan 29, 2017

The note on style-loader might be the real issue here: https://github.com/webpack-contrib/style-loader#recommended-configuration

Note about source maps support and assets referenced with url: when style loader is used with ?sourceMap option, the CSS modules will be generated as Blobs, so relative paths don't work (they would be relative to chrome:blob or chrome:devtools). In order for assets to maintain correct paths setting output.publicPath property of webpack configuration must be set, so that absolute paths are generated.

filipesilva added a commit to filipesilva/angular-cli that referenced this issue Jan 29, 2017
This addresses a limitation with `style-loader` where asset urls would not be generated correctly.

Fix angular#4273
filipesilva added a commit that referenced this issue Jan 30, 2017
This addresses a limitation with `style-loader` where asset urls would not be generated correctly.

Fix #4273
MRHarrison pushed a commit to MRHarrison/angular-cli that referenced this issue Feb 9, 2017
This addresses a limitation with `style-loader` where asset urls would not be generated correctly.

Fix angular#4273
@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 Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant