Skip to content
This repository has been archived by the owner on Dec 10, 2019. It is now read-only.

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

Closed
alex-page opened this issue Nov 14, 2016 · 6 comments

Comments

@alex-page
Copy link

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
Copy link

giuseppepaul commented Nov 14, 2016

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

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

@giuseppepaul
Copy link

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
Copy link
Author

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

@bmuenzenmeyer
Copy link
Member

Will be resolved for everyone when pattern-lab/patternlab-node#558 hits a release

@ba55ie
Copy link

ba55ie commented Nov 17, 2016

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
Copy link
Member

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants