1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

npm run storybook が動かなかったが、あるjs に1行足せば動いた話

Last updated at Posted at 2022-11-15

前提

$ node -v
v18.7.0

参考書

TypeScriptとReact/Next.jsでつくる実践Webアプリケーション開発

起きたこと

storybook が起動しない!

$ npm run storybook 

> nextjs-gihyo-book@0.1.0 storybook
> start-storybook -p 6006

info @storybook/react v6.5.13
info 
info => Loading presets
info Addon-docs: using MDX1
info => Using implicit CSS loaders
info => Using default Webpack5 setup
<i> [webpack-dev-middleware] wait until bundle finished
9% setup compilation DocGenPluginnode:internal/modules/cjs/loader:959
  throw err;
  ^

Error: Cannot find module 'webpack/lib/util/makeSerializable.js'
Require stack:
<略>
  ]
}

Node.js v18.7.0

対処方法

storybook Cannot find module 'webpack/lib/util/makeSerializable.js' でググる

ヒットした記事

対処方法としては、下記コメントで言及されているとおり.storybook/main.jsを修正することで対処できました。

.storybook/main.js
module.exports = {
  "typescript" : { reactDocgen: false }, // 追加
  
}

参考

結果

上記の対応で、無事動きました。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?