Cannot find module '@redwoodjs/testing/web' when running Storybook
See original GitHub issueHaving followed the tutorial up to chapter 5, i am getting this error in the dev console when i run yarn rw storybook
:
All of the stories just render a blank page in the UI, the Cells and Pages are not even listed.
I am unsure whether this is typescript related or not – from my experience any typescript errors are gracefully handled when compiling to JS, and this seems to be a webpack error message.
However, when i run the js-based https://github.com/redwoodjs/redwood-tutorial there is no such error – the dependencies listed in package.json
are identical to my project, which you can check out here: https://github.com/Philzen/redwoodblog-tutorial-typescript
Any ideas what’s going on here greatly appreciated.
Issue Analytics
- State:
- Created a year ago
- Comments:15 (9 by maintainers)
Top Results From Across the Web
Issues with Storybook (REDWOOD ...
Hello all,. So I'm working on a project using RedwoodJS and when I tried running yarn rw storybook. I'm getting these errors
Read more >Replacing index.css with index.scss and Storybook issue
I got some errors running yarn rw storybook , which included the following line: Module not found: Error: Can't resolve ...
Read more >Update to 3.0 breaks component tests - headers-polyfill/lib
Patch Release This releases fixes the Cannot find module 'headers-polyfill/lib' error seen when using mock service worker (MSW) in tests or ...
Read more >Redwood v0.32 - Releases and Upgrade Guides
At first Error: Cannot find module 'graphql-tag' didn't make sense to me since I not using anything graphql related in my identity-signup ...
Read more >Build error when configuring storybook
module.exports = { addons: [ '@storybook/addon-essentials', 'storybook-addon-themes'], }. But this is the only approach I found to disable ...
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
OK FOUND ISSUE! This solves both issues.
Tried a bunch of theories, but pulling on the thread from this issue, it looks like this happens when storybook for some reason picks webpack 4 accidentally (extrapolating from this thread) - When there are multiple versions of webpack 5 (in our case, redwood is using 5.70.0, but storybook wants 5.71.0) - see this output from yarn why
The solution for now, is to force the resolution of webpack 5, but we should issue a patch with the updated webpack version so theres no mismatch. Note that its not the updated webpack that solves the problem, its definitely a storybook thing, because even if you set the webpack version to 5.70.0 it still works fine
In your root package.json
Walkthrough here: https://s.tape.sh/fMzJpPyA
Confirming that upgrading to the latest canary fixes it in the reproduction Gitpod!