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

assets.manager can be undefined even when assets is not undefined #640

Merged
merged 1 commit into from
Dec 5, 2016

Conversation

chibicode
Copy link
Contributor

@chibicode chibicode commented Dec 5, 2016

I think the code was missing a check when assets is not undefined but assets.manager is undefined. The code right above says so in the comment:

// assets.manager will be:
// - undefined
// ...

I found out about this b/c I was getting this error. I have reverted to "@kadira/storybook": "2.29.1" to get this to work.

> build-storybook -o dist/storybook

@kadira/storybook v2.29.7

=> Loading custom .babelrc
=> Loading custom webpack config.
Building storybook ...
/Users/shu/code/es-frontend/node_modules/@kadira/storybook/dist/server/index.html.js:44
    js: assets.manager.find(function (filename) {
                      ^

TypeError: Cannot read property 'find' of undefined
    at managerUrlsFromAssets (/Users/shu/code/es-frontend/node_modules/@kadira/storybook/dist/server/index.html.js:44:23)
    at exports.default (/Users/shu/code/es-frontend/node_modules/@kadira/storybook/dist/server/index.html.js:12:21)
    at /Users/shu/code/es-frontend/node_modules/@kadira/storybook/dist/server/build.js:120:99
    at Compiler.<anonymous> (/Users/shu/code/es-frontend/node_modules/webpack/lib/Compiler.js:194:14)
    at Compiler.emitRecords (/Users/shu/code/es-frontend/node_modules/webpack/lib/Compiler.js:282:37)
    at Compiler.<anonymous> (/Users/shu/code/es-frontend/node_modules/webpack/lib/Compiler.js:187:11)
    at /Users/shu/code/es-frontend/node_modules/webpack/lib/Compiler.js:275:11
    at Compiler.applyPluginsAsync (/Users/shu/code/es-frontend/node_modules/tapable/lib/Tapable.js:60:69)
    at Compiler.afterEmit (/Users/shu/code/es-frontend/node_modules/webpack/lib/Compiler.js:272:8)
    at Compiler.<anonymous> (/Users/shu/code/es-frontend/node_modules/webpack/lib/Compiler.js:267:14)
    at /Users/shu/code/es-frontend/node_modules/async/lib/async.js:52:16
    at Object.async.forEachOf.async.eachOf (/Users/shu/code/es-frontend/node_modules/async/lib/async.js:236:30)
    at Object.async.forEach.async.each (/Users/shu/code/es-frontend/node_modules/async/lib/async.js:209:22)
    at Compiler.emitFiles (/Users/shu/code/es-frontend/node_modules/webpack/lib/Compiler.js:235:20)
    at /Users/shu/code/es-frontend/node_modules/mkdirp/index.js:48:26
    at FSReqWrap.oncomplete (fs.js:123:15)

...even when assets is not undefined.
@arunoda arunoda added the bug label Dec 5, 2016
@thani-sh thani-sh merged commit eb86b3a into storybookjs:master Dec 5, 2016
@arunoda
Copy link
Member

arunoda commented Dec 5, 2016

Thanks @chibicode for the PR.

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

Successfully merging this pull request may close these issues.

3 participants