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

@import url() not working #2595

Closed
Thomasan1999 opened this issue Jun 28, 2021 · 1 comment · Fixed by #2632
Closed

@import url() not working #2595

Thomasan1999 opened this issue Jun 28, 2021 · 1 comment · Fixed by #2632

Comments

@Thomasan1999
Copy link

When I try to import Google Fonts or any external URL via @import url('https://...'), it throws an error: Cannot read property 'isNull' of undefined.

Example:

const stylus = require('stylus');
stylus(`@import url('https://fonts.googleapis.com/css?family=Raleway:300,400,500,700|Montserrat|Inconsolata:400,700&display=swap')`).deps();

It seems to be related to:

var path = !node.path.first.val.isNull && node.path.first.val || node.path.first.name

Workaround:

@css {
    @import url('https://fonts.googleapis.com/css?family=Raleway:300,400,500,700|Montserrat|Inconsolata:400,700&display=swap')`);
}

That way Stylus doesn't compile it and the error is not thrown.

The original issue:

vitejs/vite#3984

@yklydxtt
Copy link

yklydxtt commented Jul 8, 2021

i also got this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants