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

Consecutive URL imports in CSS cause an error #89

Open
RoyTinker opened this issue Dec 12, 2017 · 4 comments
Open

Consecutive URL imports in CSS cause an error #89

RoyTinker opened this issue Dec 12, 2017 · 4 comments

Comments

@RoyTinker
Copy link

RoyTinker commented Dec 12, 2017

(mostly) reduced test case: https://github.com/RoyTinker/node-sass-watch-import-css-bug

CSS:

@import url(http://some-site.com/fonts/1);
@import url(something.css);

Error:

/[redacted]/node_modules/sass-graph/parse-imports.js:20
        throw new Error('Encountered invalid @import syntax.');
        ^

Error: Encountered invalid @import syntax.
    at parseImports (/[redacted]/node_modules/sass-graph/parse-imports.js:20:15)
    at Graph.addFile (/[redacted]/node_modules/sass-graph/sass-graph.js:69:17)
    at /[redacted]/node_modules/sass-graph/sass-graph.js:54:13
    at arrayEach (/[redacted]/node_modules/lodash/lodash.js:537:11)
    at Function.forEach (/[redacted]/node_modules/lodash/lodash.js:9359:14)
    at new Graph (/[redacted]/node_modules/sass-graph/sass-graph.js:53:7)
    at Object.module.exports.parseDir (/[redacted]/node_modules/sass-graph/sass-graph.js:156:17)
@xzyfer
Copy link
Owner

xzyfer commented Dec 13, 2017

Thanks for the issue. Sass graph should ignore url imports.

@RoyTinker RoyTinker changed the title This combination of 2 imports in CSS causes an error Consecutive URL imports in CSS cause an error Dec 21, 2017
@JohnKulp
Copy link

JohnKulp commented Nov 8, 2018

Is there any planned fix for this? This is breaking my node-sass build pipeline and seems to be a very common error case.

@shankj3
Copy link

shankj3 commented Mar 14, 2019

We just encountered this issue as well -- seems to be happening for multiple imports regardless of if they are consecutive

@Avdheshg
Copy link

(mostly) reduced test case: https://github.com/RoyTinker/node-sass-watch-import-css-bug

CSS:

@import url(http://some-site.com/fonts/1);
@import url(something.css);

Error:

/[redacted]/node_modules/sass-graph/parse-imports.js:20
        throw new Error('Encountered invalid @import syntax.');
        ^

Error: Encountered invalid @import syntax.
    at parseImports (/[redacted]/node_modules/sass-graph/parse-imports.js:20:15)
    at Graph.addFile (/[redacted]/node_modules/sass-graph/sass-graph.js:69:17)
    at /[redacted]/node_modules/sass-graph/sass-graph.js:54:13
    at arrayEach (/[redacted]/node_modules/lodash/lodash.js:537:11)
    at Function.forEach (/[redacted]/node_modules/lodash/lodash.js:9359:14)
    at new Graph (/[redacted]/node_modules/sass-graph/sass-graph.js:53:7)
    at Object.module.exports.parseDir (/[redacted]/node_modules/sass-graph/sass-graph.js:156:17)

I was getting the same error when I was working with the multiple sass files
My mistake was @import "folder-name/file-name" (Here i forgot to add a semicolon ; )
but when I have added the semicolon Everything works perfect

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

No branches or pull requests

5 participants