addon-docs: `obj.serialize is not a function` when using Webpack 5 filesystem cache
See original GitHub issueDescribe the bug
It seems the Webpack 5 cache isn’t able to handle files through addon-docs
<w> [webpack.cache.PackFileCacheStrategy] Skipped not serializable cache item 'Compilation/modules|/Users/tomross/dev/storybook-repod/example/node_modules/babel-loader/lib/index.js??ruleSet[1].rules[0].use[0]!/Users/tomross/dev/storybook-repod/example/stories/Container.tsx': obj.serialize is not a function
<w> while serializing webpack/lib/cache/PackFileCacheStrategy.PackContentItems -> webpack/lib/NormalModule -> Array { 5 items } -> react-docgen-typescript-plugin/dist/dependency
To Reproduce Clone https://github.com/umpox/storybook-repod
cd example
yarn
yarn storybook
System
Environment Info:
System:
OS: macOS 10.15.7
CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Binaries:
Node: 14.15.4 - ~/.nvm/versions/node/v14.15.4/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.14.10 - ~/.nvm/versions/node/v14.15.4/bin/npm
Browsers:
Chrome: 92.0.4515.107
Firefox: 88.0
Safari: 14.1.2
npmPackages:
@storybook/addon-actions: ^6.3.6 => 6.3.6
@storybook/addon-essentials: ^6.3.6 => 6.3.6
@storybook/addon-links: ^6.3.6 => 6.3.6
@storybook/builder-webpack5: ^6.3.6 => 6.3.6
@storybook/manager-webpack5: ^6.3.6 => 6.3.6
@storybook/react: ^6.3.6 => 6.3.6
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Cache - webpack
cache.maxMemoryGenerations: 0 : Persistent cache will not use an additional memory cache. It will only cache items in memory until they are serialized...
Read more >Webpack: Object(...) is not a function after re-bundling
Our issue was fixed by removing new webpack.optimize.ModuleConcatenationPlugin() from the plugins section of our webpack config.
Read more >@storybook/builder-webpack4 | Yarn - Package Manager
Builder implemented with webpack4 and webpack4 -compatible loaders/plugins/config, used by @storybook/core-server to build the preview iframe.
Read more >Third Party Software 7.2 - Confluent
Third Party Software included in Confluent Platform 7.2 ; "Java Concurrency in Practice" book annotations, CC-BY-2.5 ; a11y-react-emoji, MIT ; aalto-xml, Apache- ...
Read more >chore(deps): update frontend - webpack (master) (major)
Pass external dependencies from Babel to Webpack by @nicolo-ribaudo ... avoid writing more than 2GB at once during cache serialization (as ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@shilman After debugging, I found out we should add a couple of webpack 5 related serialization methods to the doc dependency. I pushed the fix to https://github.com/hipstersmoothie/react-docgen-typescript-plugin/pull/45 and you can cherrypick it through the commit 543e9056e51a3b27 from my branch to test against. Maybe it’s good to do a canary release first to confirm the fix.
Well, yeah, seems that we need to stabilize the order of keys. Just made 2 build in row and got this diff