ournameismud / mud-fractal

Fractal/Mudstone Frontend Boilerplate
19 stars 3 forks source link

Cannot read property 'bindings' of null #14

Closed brianjhanson closed 6 years ago

brianjhanson commented 6 years ago

Hey!

I just stumbled across this starter and was trying to give it a whirl, but upon running npm run start I got the following error:

➜ npm run start

> mud-fractal@2.0.1 start /Users/***/Development/mud-fractal
> gulp

[22:25:03] Requiring external module @babel/register
/Users/***/Development/mud-fractal/node_modules/@babel/core/node_modules/@babel/traverse/lib/scope/index.js:869
      scope.bindings[name] = info;
           ^

TypeError: Cannot read property 'bindings' of null
    at Scope.moveBindingTo (/Users/***/Development/mud-fractal/node_modules/@babel/core/node_modules/@babel/traverse/lib/scope/index.js:869:12)
    at BlockScoping.updateScopeInfo (/Users/***/Development/mud-fractal/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:364:17)
    at BlockScoping.run (/Users/***/Development/mud-fractal/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:330:12)
    at PluginPass.BlockStatementSwitchStatementProgram (/Users/***/Development/mud-fractal/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:70:24)
    at newFn (/Users/***/Development/mud-fractal/node_modules/@babel/core/node_modules/@babel/traverse/lib/visitors.js:193:21)
    at NodePath._call (/Users/***/Development/mud-fractal/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/context.js:53:20)
    at NodePath.call (/Users/***/Development/mud-fractal/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/context.js:40:17)
    at NodePath.visit (/Users/***/Development/mud-fractal/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/context.js:88:12)
    at TraversalContext.visitQueue (/Users/***/Development/mud-fractal/node_modules/@babel/core/node_modules/@babel/traverse/lib/context.js:118:16)
    at TraversalContext.visitSingle (/Users/***/Development/mud-fractal/node_modules/@babel/core/node_modules/@babel/traverse/lib/context.js:90:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mud-fractal@2.0.1 start: `gulp`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mud-fractal@2.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/***/.npm/_logs/2018-08-05T03_25_04_290Z-debug.log

On a hunch, I renamed gulpfile.babel.js to just gulpfile.js and that seems to have solved it. Not sure if this is an "everyone" issue or a "me" issue, but wanted to file it either way.

Happy to submit a PR with this change if it's desired.

dhmax88 commented 6 years ago

Hi @brianjhanson – what version of Node were you running at the time?

brianjhanson commented 6 years ago

Thanks for the quick response @dhmax88!

I was / am running 8.6.0 (from the .nvmrc file).

Here's the full rpm debug log:

0 info it worked if it ends with ok
1 verbose cli [ '/Users/***/.nvm/versions/node/v8.6.0/bin/node',
1 verbose cli   '/Users/***/.nvm/versions/node/v8.6.0/bin/npm',
1 verbose cli   'start' ]
2 info using npm@5.3.0
3 info using node@v8.6.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle mud-fractal@2.0.1~prestart: mud-fractal@2.0.1
6 info lifecycle mud-fractal@2.0.1~start: mud-fractal@2.0.1
7 verbose lifecycle mud-fractal@2.0.1~start: unsafe-perm in lifecycle true
8 verbose lifecycle mud-fractal@2.0.1~start: PATH: /Users/***/.nvm/versions/node/v8.6.0/lib/node_modules/npm/bin/node-gyp-bin:/Users/***/Development/mud-fractal/node_modules/.bin:/Users/***/.yarn/bin:/Users/***/.config/yarn/global/node_modules/.bin:/Users/***/.nvm/versions/node/v8.6.0/bin:/Applications/MAMP/Library/bin/:/Applications/MAMP/bin/php/php7.1.12/bin:/Users/***/.composer/vendor/bin:/usr/local/sbin:/Users/***/.fastlane/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/***/.composer/vendor/bin:/Users/***/n/bin
9 verbose lifecycle mud-fractal@2.0.1~start: CWD: /Users/***/Development/mud-fractal
10 silly lifecycle mud-fractal@2.0.1~start: Args: [ '-c', 'gulp' ]
11 silly lifecycle mud-fractal@2.0.1~start: Returned: code: 1  signal: null
12 info lifecycle mud-fractal@2.0.1~start: Failed to exec start script
13 verbose stack Error: mud-fractal@2.0.1 start: `gulp`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/Users/***/.nvm/versions/node/v8.6.0/lib/node_modules/npm/lib/utils/lifecycle.js:289:16)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at EventEmitter.emit (events.js:213:7)
13 verbose stack     at ChildProcess.<anonymous> (/Users/***/.nvm/versions/node/v8.6.0/lib/node_modules/npm/lib/utils/spawn.js:40:14)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at ChildProcess.emit (events.js:213:7)
13 verbose stack     at maybeClose (internal/child_process.js:927:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
14 verbose pkgid mud-fractal@2.0.1
15 verbose cwd /Users/***/Development/mud-fractal
16 verbose Darwin 17.7.0
17 verbose argv "/Users/***/.nvm/versions/node/v8.6.0/bin/node" "/Users/***/.nvm/versions/node/v8.6.0/bin/npm" "start"
18 verbose node v8.6.0
19 verbose npm  v5.3.0
20 error code ELIFECYCLE
21 error errno 1
22 error mud-fractal@2.0.1 start: `gulp`
22 error Exit status 1
23 error Failed at the mud-fractal@2.0.1 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
dhmax88 commented 6 years ago

Hi @brianjhanson

Changing the name of the gulpfile does resolve the problem. It was changed to gulpfile.babel.js when it was written with es6 import/export syntax.

We'll update it today... are you using the repo for a Craft CMS site?

brianjhanson commented 6 years ago

Thanks! I feel like it should work, but I can’t seem to find much documentation about *.babel.js files.

I am not using it for a real project yet, just poking around a bit, but it looks pretty cool! Hoping to try it out on a project in the near future.

magicspon commented 6 years ago

@brianjhanson

re: *.babel.js, I believe I got it from here: https://markgoodyear.com/2015/06/using-es6-with-gulp/