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 protocol relative url no longer handled in postcss-loader #12648

Closed
mrjpeterj opened this issue Oct 19, 2018 · 1 comment · Fixed by #12651
Closed

css protocol relative url no longer handled in postcss-loader #12648

mrjpeterj opened this issue Oct 19, 2018 · 1 comment · Fixed by #12651
Labels
area: devkit/build-angular freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix
Milestone

Comments

@mrjpeterj
Copy link

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

Angular CLI: 7.0.1
Node: 8.11.1
OS: win32 x64
Angular: 7.0.0
... animations, cdk, common, compiler, compiler-cli, core, forms
... http, language-service, material, platform-browser
... platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.10.1
@angular-devkit/build-angular 0.10.1
@angular-devkit/build-optimizer 0.10.1
@angular-devkit/build-webpack 0.10.1
@angular-devkit/core 7.0.1
@angular-devkit/schematics 7.0.1
@angular/cli 7.0.1
@angular/flex-layout 7.0.0-beta.19
@ngtools/webpack 7.0.1
@schematics/angular 7.0.1
@schematics/update 0.10.1
rxjs 6.3.3
typescript 3.1.3
webpack 4.19.1

Repro steps

Try to build a project with a css url that uses a protocol relative url

The log given by the failure

ERROR in ./src/styles.scss
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleError: Module Error (from ./node_modules/postcss-loader/lib/index.js):
(Emitted value instead of an instance of Error) CssSyntaxError: E:\src\tangentix\pdeplatform\DataDelivery\Hub\UI2\src\styles.scss:2001:26: Can't resolve '//imgcdn.gamesessions.com/gs-web-new/classic-bg.jpg' in 'E:\src\tangentix\pdeplatform\DataDelivery\Hub\UI2\src'

  1999 |
  2000 | .std-bg {
> 2001 |   background-image: url("//imgcdn.gamesessions.com/gs-web-new/classic-bg.jpg");
       |                          ^
  2002 |   background-size: inherit;
  2003 |   background-repeat: no-repeat;

    at Object.emitError (E:\src\tangentix\pdeplatform\DataDelivery\Hub\UI2\node_modules\webpack\lib\NormalModule.js:169:6)
    at Promise.all.urlDeclarations.map (E:\src\tangentix\pdeplatform\DataDelivery\Hub\UI2\node_modules\@angular-devkit\build-angular\src\angular-cli-files\plugins\postcss-cli-resources.js:131:28)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

Desired functionality

This should still work as before, since it is valid css

Mention any other details that might be useful

After updating from @angular/cli 6.2.1 and @angular-devkit/build-angular 0.7.0 the sccs fragment of

.std-bg {
    background-image: url("//imgcdn.gamesessions.com/gs-web-new/classic-bg.jpg");
}

no longer builds

@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 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: devkit/build-angular freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants