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

root is not defined #60

Closed
iamvdo opened this issue Jul 24, 2014 · 3 comments
Closed

root is not defined #60

iamvdo opened this issue Jul 24, 2014 · 3 comments

Comments

@iamvdo
Copy link
Contributor

iamvdo commented Jul 24, 2014

I have this strange error with many module. See stacktrace:

"ReferenceError: root is not defined
    at Declaration.style (:21023:12)
    at Declaration.stringify (:20632:22)
    at Rule.stringifyContent (:20342:23)
    at Rule.stringifyBlock (:20363:10)
    at Rule.stringify (:21833:10)
    at Root.stringifyContent (:20338:23)
    at Root.stringify (:21788:10)
    at Root.toString (:20976:10)
    at MapGenerator.generate (:20916:25)
    at Result.stringify (:21756:46)"

Lines no matter here, it's in node.js line 136 root = this;. If I write if (!root) {var root = this;}, it's OK. Very weird.
It's OK (no error) with AutoPrefixer, postcss-vars, but NOK (error) with pixrem, pleeease-filters.

If you have an idea, it'll be good. Try to find where the problem is btw.

@iamvdo
Copy link
Contributor Author

iamvdo commented Jul 24, 2014

Firefox has a slightly better error: "ReferenceError: assignment to undeclared variable root".
So is there a reason why it's root = this and not var root = this ?

Plus, the problem appears only in browser, not programmatically, so it feels more weird to me.

@ai
Copy link
Member

ai commented Jul 24, 2014

Yeap. I fix this issue, when I migrate from Traceur.

It was a ES6 migration issue, that wasn’t found by tests :(.

@ai
Copy link
Member

ai commented Jul 24, 2014

Fix is pushed 1e2c522

@ai ai closed this as completed Jul 24, 2014
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