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

Getting error with babel inside Gatsby #195

Closed
nmn opened this issue Mar 18, 2016 · 7 comments
Closed

Getting error with babel inside Gatsby #195

nmn opened this issue Mar 18, 2016 · 7 comments

Comments

@nmn
Copy link

nmn commented Mar 18, 2016

Everytime I try to do gatsby develop I get this error.

I've tried the two latest versions of gatsby with the same result.
I tried use the master from github, ran the build scripts, set published to true and then got the same result.

I guess this is connected to the other issue to upgrade to babel 6. But am I just missing something?

/usr/local/lib/node_modules/gatsby/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 (/usr/local/lib/node_modules/gatsby/node_modules/babel-core/lib/transformation/file/options/option-manager.js:126:28)
  at OptionManager.addConfig (/usr/local/lib/node_modules/gatsby/node_modules/babel-core/lib/transformation/file/options/option-manager.js:107:10)
  at OptionManager.findConfigs (/usr/local/lib/node_modules/gatsby/node_modules/babel-core/lib/transformation/file/options/option-manager.js:168:35)
  at OptionManager.init (/usr/local/lib/node_modules/gatsby/node_modules/babel-core/lib/transformation/file/options/option-manager.js:229:12)
  at compile (/usr/local/lib/node_modules/gatsby/node_modules/babel-core/lib/api/register/node.js:117:22)
  at normalLoader (/usr/local/lib/node_modules/gatsby/node_modules/babel-core/lib/api/register/node.js:199:14)
  at Object.require.extensions.(anonymous function) [as .js] (/usr/local/lib/node_modules/gatsby/node_modules/babel-core/lib/api/register/node.js:216:7)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:311:12)
  at Module.require (module.js:366:17)
  at require (module.js:385:17)
  at module.exports (/usr/local/lib/node_modules/gatsby/dist/utils/glob-pages.js:42:13)
  at module.exports (/usr/local/lib/node_modules/gatsby/dist/utils/develop.js:85:37)
  at Object.<anonymous> (/usr/local/lib/node_modules/gatsby/bin/develop.js:36:1)
  at Module._compile (module.js:435:26)
  at Module._extensions..js (module.js:442:10)
  at Object.require.extensions.(anonymous function) [as .js] (/usr/local/lib/node_modules/gatsby/node_modules/babel-core/lib/api/register/node.js:214:7)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:311:12)
  at Module.require (module.js:366:17)
  at require (module.js:385:17)
  at Object.<anonymous> (/usr/local/lib/node_modules/gatsby/bin/gatsby-develop.js:4:1)
  at Module._compile (module.js:435:26)
  at Object.Module._extensions..js (module.js:442:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:311:12)
  at Function.Module.runMain (module.js:467:10)
  at startup (node.js:136:18)
  at node.js:963:3
@KyleAMathews
Copy link
Contributor

Are you trying to use Babel 6 with your site?
On Fri, Mar 18, 2016 at 3:30 PM Naman Goel [email protected] wrote:

Everytime I try to do gatsby develop I get this error.

I've tried the two latest versions of gatsby with the same result.
I tried use the master from github, ran the build scripts, set published
to true and then got the same result.

I guess this is connected to the other issue to upgrade to babel 6. But am
I just missing something?

/usr/local/lib/node_modules/gatsby/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 (/usr/local/lib/node_modules/gatsby/node_modules/babel-core/lib/transformation/file/options/option-manager.js:126:28)
at OptionManager.addConfig (/usr/local/lib/node_modules/gatsby/node_modules/babel-core/lib/transformation/file/options/option-manager.js:107:10)
at OptionManager.findConfigs (/usr/local/lib/node_modules/gatsby/node_modules/babel-core/lib/transformation/file/options/option-manager.js:168:35)
at OptionManager.init (/usr/local/lib/node_modules/gatsby/node_modules/babel-core/lib/transformation/file/options/option-manager.js:229:12)
at compile (/usr/local/lib/node_modules/gatsby/node_modules/babel-core/lib/api/register/node.js:117:22)
at normalLoader (/usr/local/lib/node_modules/gatsby/node_modules/babel-core/lib/api/register/node.js:199:14)
at Object.require.extensions.(anonymous function) as .js
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at module.exports (/usr/local/lib/node_modules/gatsby/dist/utils/glob-pages.js:42:13)
at module.exports (/usr/local/lib/node_modules/gatsby/dist/utils/develop.js:85:37)
at Object. (/usr/local/lib/node_modules/gatsby/bin/develop.js:36:1)
at Module._compile (module.js:435:26)
at Module._extensions..js (module.js:442:10)
at Object.require.extensions.(anonymous function) as .js
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object. (/usr/local/lib/node_modules/gatsby/bin/gatsby-develop.js:4:1)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:136:18)
at node.js:963:3


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#195

@nmn
Copy link
Author

nmn commented Mar 19, 2016

No, I just used Gatsby to generate and then gatsby develop

@KyleAMathews
Copy link
Contributor

So you ran:

gatsby new test-gatsby-site
cd test-gatsby-site
gatsby develop

And then saw this error?

@tleunen
Copy link
Contributor

tleunen commented Mar 19, 2016

This is the error I also get when I try to generate and test a gatsby site inside a project using Babel 6.
But I don't understand why there's a conflict between the parent Babel and the Babel used by gatsby.

The directory generated by gatsby has its own dependencies, its own babelrc file, so why is there a conflict?

@KyleAMathews
Copy link
Contributor

It's beyond me why but that's how Babel works. As I understand it, Babel looks to parent directories (perhaps until it finds a .git directory?) for .babelrc. In any case, I've actually been working today on updating Gatsby to Babel 6 so this should be fixed soon.

Just to double-check we understand the problem correctly — if you copy the Gatsby site to its own directory does it work then?

@KyleAMathews
Copy link
Contributor

And here's the PR actually :) https://github.com/gatsbyjs/gatsby/pull/197/files

Want to also make Gatsby default to using the locally installed version of Gatsby so not going to merge and release this tonight but if you want to clone the PR and see if that gets you working, that'd be great.

@tleunen
Copy link
Contributor

tleunen commented Mar 20, 2016

Yes @KyleAMathews, if it's in a complete different directory (or if the babelrc of the parent directory is removed), it works as expected.

I'll test it :)

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

3 participants