Skip to content

Local .babelrc breaks scss-tokenizer #10

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

Closed
nybblr opened this issue Apr 28, 2017 · 5 comments
Closed

Local .babelrc breaks scss-tokenizer #10

nybblr opened this issue Apr 28, 2017 · 5 comments
Assignees
Labels

Comments

@nybblr
Copy link

nybblr commented Apr 28, 2017

I just clean installed node-sass (same patch version I think) and through a dependency of a dependency it now includes scss-tokenizer. I'm getting this cryptic error:

$ ./node_modules/.bin/node-sass

/Users/jonathan/my-app/node_modules/scss-tokenizer/node_modules/babel-core/lib/transformation/file/options/option-manager.js:126
      if (!option) this.log.error("Unknown option: " + alias + "." + key, ReferenceError);
                           ^

TypeError: Cannot read property 'error' of undefined
    at OptionManager.mergeOptions (/Users/jonathan/my-app/node_modules/scss-tokenizer/node_modules/babel-core/lib/transformation/file/options/option-manager.js:126:28)
    at OptionManager.addConfig (/Users/jonathan/my-app/node_modules/scss-tokenizer/node_modules/babel-core/lib/transformation/file/options/option-manager.js:107:10)
    at OptionManager.findConfigs (/Users/jonathan/my-app/node_modules/scss-tokenizer/node_modules/babel-core/lib/transformation/file/options/option-manager.js:168:35)
    at OptionManager.init (/Users/jonathan/my-app/node_modules/scss-tokenizer/node_modules/babel-core/lib/transformation/file/options/option-manager.js:229:12)
    at compile (/Users/jonathan/my-app/node_modules/scss-tokenizer/node_modules/babel-core/lib/api/register/node.js:117:22)
    at normalLoader (/Users/jonathan/my-app/node_modules/scss-tokenizer/node_modules/babel-core/lib/api/register/node.js:199:14)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/jonathan/my-app/node_modules/scss-tokenizer/node_modules/babel-core/lib/api/register/node.js:216:7)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

I tried a few things, then nuked my local .babelrc config and node-sass worked. So my guess is scss-tokenizer is using my local .babelrc automatically?

Perhaps adding an explicit config to this package would prevent that?

@nybblr
Copy link
Author

nybblr commented Apr 28, 2017

Ahh, this might also do the trick: https://babeljs.io/docs/usage/babelrc/#lookup-behavior

I'll test adding this option locally and see if it works.

@nybblr
Copy link
Author

nybblr commented Apr 28, 2017

Ah, since this is using an older version of Babel, adding this to scss-tokenizer's package.json prevents the lookup behavior:

"babel": {
  "breakConfig": true
}

Quick PR, or is there another PR in progress that will fix this issue?

@fozzle
Copy link

fozzle commented Apr 28, 2017

Having the same issue. I have temporarily resolved it by forking node-sass to use a 2.1.1 dependency for sass-graph instead of ^2.1.1 . It appears sass-graph was updated yesterday and that's when this library as added as a dependency. The blessings and curses of the npm ecosystem :)

@xzyfer
Copy link
Member

xzyfer commented Apr 29, 2017

Thanks all. I unpublished sass-graph 2.2.0 but for some reason people were still getting it. Looks like there may be an issue for yarn users - yarnpkg/yarn#3274

Testing #11 locally before publishing a new release.

@xzyfer
Copy link
Member

xzyfer commented Apr 29, 2017

Thanks all!

@xzyfer xzyfer closed this as completed Apr 29, 2017
@xzyfer xzyfer added the bug label Dec 3, 2018
@xzyfer xzyfer self-assigned this Dec 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants