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.preview is undefined #663

Closed
sir-marc opened this issue Jan 10, 2017 · 8 comments
Closed

assets.preview is undefined #663

sir-marc opened this issue Jan 10, 2017 · 8 comments

Comments

@sir-marc
Copy link

pendant to #640

i got the same error:

js: assets.preview.find(function (filename) {
                  ^

TypeError: Cannot read property 'find' of undefined

when i changed the code like the mentioned pull request in iframe.html.js on line 38 to:

if (!assets || !assets.preview) {
    return {
      js: 'static/preview.bundle.js',
    };
  }

I did not get an error message anymore, but the site is still not working. It does not create a static folder in which the manager.bundle.js should be.

@kadira/storybook v2.35.2

@kylpo
Copy link

kylpo commented Jan 11, 2017

For me, this was a webpack.config.js issue. When I deleted the file to reverted back to storybook's default webpack config, build-storybook worked without the 'find' error.

@sir-marc
Copy link
Author

This is not an option for me as I'm depending on vairous things from webpack such as loaders (not included in the base setup e.g. TS or Sass), Path mappings and Plugins.

@arunoda
Copy link
Member

arunoda commented Jan 12, 2017

The fix you did is a good one.
If I can get a sample repo, I could work on this more.

@ndelangen
Copy link
Member

I think the problem is you node version doesn't have Array.prototype.find. Can you use a more modern version of node?

Please re-open if you are experiencing this issue with a modern version of node.

@syabro
Copy link
Contributor

syabro commented Jul 20, 2017

@ndelangen have the same error
and how with error TypeError: Cannot read property 'find' of undefined you got the idea of not modern version of node
Does undefined in your node have a .find method?

@syabro
Copy link
Contributor

syabro commented Jul 20, 2017

UPD: I've fixed the issue by disabling HotModuleReplacementPlugin in plugins

@ndelangen
Copy link
Member

Does undefined in your node have a .find method?

Whoops, my bad; you're right.

@danielduan
Copy link
Member

Closing issue because it's v2. Please reopen if this is still an issue on the latest v3.

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

No branches or pull requests

6 participants