Code Monkey home page Code Monkey logo

Comments (8)

RyanClementsHax avatar RyanClementsHax commented on July 24, 2024

Thanks for opening this!

It seems that you are using the webpack 4 builder instead of the webpack 5 builder. Can you try to use the webpack 5 builder and see if that works for you?

The instructions are here

from storybook-addon-next.

tremby avatar tremby commented on July 24, 2024

I've no idea which builder I'm using. It's whatever is currently default for Next and Storybook -- this is in line with "no config", isn't it? ;)

Yes, the error goes away if I replace the Storybook line with npx sb init --builder webpack5.

Is there some way to give a friendlier error message in this situation? Perhaps you can detect Storybook was set up with Webpack 4 and emit a warning?

from storybook-addon-next.

tremby avatar tremby commented on July 24, 2024

In my actual project, however, I'm getting Error: Cannot find module 'webpack/lib/util/makeSerializable.js', with a stacktrace pointing to react-docgen-typescript-plugin. I've no idea if that's a bug with this package, or with Storybook, or with react-docgen-typescript-plugin.

Reproducable from scratch with

npx create-next-app@latest bug --typescript
cd bug
npx sb init --builder webpack5 # and say yes to linter
npm i -D --force storybook-addon-next
< add addon to config >
npm run storybook

from storybook-addon-next.

RyanClementsHax avatar RyanClementsHax commented on July 24, 2024

Oh my. That's an error storybook hasn't fixed yet (you can search for this issues on their GitHub project page). The current working solution is to install webpack as a dev dependency to your project.

I should probably put something addressing this in the docs.

Thanks for bringing this to my attention. I really appreciate it.

from storybook-addon-next.

tremby avatar tremby commented on July 24, 2024

Ah while you responded here I thought "this ought to be a separate ticket" and opened #80. I'll look at storybook's issues...

from storybook-addon-next.

tremby avatar tremby commented on July 24, 2024

Oh my goodness I'd missed part of what you said above:

The current working solution is to install webpack as a dev dependency to your project.

It's working beautifully now. Thank you!

I'll leave this open since I think a better error message for when webpack 5 hasn't been activated would be a good idea.

from storybook-addon-next.

github-actions avatar github-actions commented on July 24, 2024

This issue has been automatically marked stale because it it received no activity for 60 days. If you wish to keep this open, please leave a comment. Thanks.

from storybook-addon-next.

github-actions avatar github-actions commented on July 24, 2024

This issue has been automatically closed because it received no activity for 60 days. If you think this was closed by accident, please leave a comment. Thanks.

from storybook-addon-next.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.