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

Having multiple @import in one file throws a TypeError #73

Open
mcibique opened this issue Jan 5, 2017 · 2 comments
Open

Having multiple @import in one file throws a TypeError #73

mcibique opened this issue Jan 5, 2017 · 2 comments

Comments

@mcibique
Copy link
Contributor

mcibique commented Jan 5, 2017

I'm using [email protected] and I have css file with two imports:

@import "file1.css";
@import "file2.css";

First import is processed properly, but the second one throws an error:

TypeError: Cannot read property '1' of null
    at walkThroughtImports (C:\projects\my-project\node_modules\postcss-cachebuster\index.js:84:26)

It is caused because walkThroughtImports() uses regexp with 'g' flag but do not reset the lastIndex back to 0 after first usage. Adding pattern.lastIndex = 0; before calling pattern.exec(atrule.params) solves the problem.

@glebmachine
Copy link
Owner

glebmachine commented Jan 5, 2017 via email

@mcibique
Copy link
Contributor Author

mcibique commented Jan 8, 2017

Sure. #75

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

2 participants