Skip to content

[Dart] Transformer url resolver should handle @import statements in stylesheets #4559

Closed

Description

@andresaraujo

The Dart transformer fails if a stylesheet contains a @import statement. (alpha 39)

Project layout

.
├── lib
│   ├── app.dart
│   └── app.html
├── packages
└── web
    ├── index.html
    ├── main.dart
    └── styles
        └── main.css

main.css

@import url(https://fonts.googleapis.com/css?family=Roboto);

...

Error:

Build error:
Transform StylesheetCompiler on ng2_dart_quickstart|web/styles/main.css threw error: Invalid argument (absoluteUri): Unsupported URI scheme encountered: Instance of 'Uri'
package:angular2/src/transform/common/url_resolver.dart 42            TransformerUrlResolver.toAssetScheme
package:angular2/src/transform/common/url_resolver.dart 16            TransformerUrlResolver.resolve
package:angular2/src/core/compiler/style_url_resolver.dart 32         extractUrls.<fn>

Activity

  1. vicb commented on Oct 6, 2015

    @vicb
    Contributor

    would @import url("https://fonts.googleapis.com/css?family=Roboto"); work ?

  2. andresaraujo commented on Oct 6, 2015

    @andresaraujo
    Author

    Nope, It still fails @vicb

  3. yjbanov commented on Oct 6, 2015

    @yjbanov
    Contributor

    This is a bug in template pre-compiler. Will fix.

  4. self-assigned this
    on Oct 6, 2015
  5. yjbanov commented on Oct 8, 2015

    @yjbanov
    Contributor

    @andresaraujo: we should be able to handle absolute @import URIs properly. Could you give it a try and report if the issue is fixed?

  6. yjbanov commented on Oct 8, 2015

    @yjbanov
    Contributor

    Closing for now. Please reopen if the issue is still there.

  7. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    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.

  8. locked and limited conversation to collaborators on Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions