pattern-lab / edition-node-gulp

ARCHIVED - The gulp wrapper around patternlab-node core, providing tasks to interact with the core library and move supporting frontend assets.
MIT License
279 stars 111 forks source link

Cannot read property 'length' of undefined - plugins.length() in patternlab-viewer.js #91

Closed alex-page closed 6 years ago

alex-page commented 8 years ago

I am using Pattern Lab Node- Gulp Edition v1.3.4 on Mac.

Expected Behavior

No errors in console on a fresh install.

Actual Behavior

Cannot read property 'length' of undefined - plugins.length() in patternlab-viewer.js

Steps to Reproduce
  1. Download pattern lab gulp edition from the website
  2. Make sure gulp is the correct version following documentation
  3. Run gulp patternlab:serve
  4. Open chrome and open http://localhost:3000/
  5. View the console for the error.
giuseppepaul commented 8 years ago

I'm getting this same error on a Windows machine:

Windows 10 Any browser Node v6.9.1 Gulp cli v1.2.2

giuseppepaul commented 8 years ago

The above change fixes this for me, but you also need to make sure you have a:

plugins: {}

in your patternlab-config.js file.

alex-page commented 8 years ago

Awesome that worked for me, I assume you meant: "plugins": {},

bmuenzenmeyer commented 8 years ago

Will be resolved for everyone when https://github.com/pattern-lab/patternlab-node/pull/558 hits a release

ba55ie commented 7 years ago

FYI, I have the same error with the Grunt edition. Therefor I think the bug should be fixed in the styleguidekit-assets-default project. Adding a simple check for the (global) variable plugins will do the trick.

if (!plugins) {
   return;
}

https://github.com/pattern-lab/styleguidekit-assets-default/blob/master/src/js/plugin-loader.js#L19

bmuenzenmeyer commented 7 years ago

styleguidekit assets default is cross-platform with the PHP version, which is not suffering the issue. The fix I linked to above will resolve this for gulp and grunt node editions. stay tuned