Mock service worker installed in the wrong place - why? #2653
Answered
by
kettanaito
binarykitchen
asked this question in
Q&A
|
Hello everyone, Thanks for the helpful library. Although I'm a bit stuck with this error To reproduce,
Bang, errors with: I initialised it before with npx msw init ./.storybook/public --save Still errors. It's a component library without a public folder. That's why I've put the mock service worker in the storybook folder instead. Advice welcome :) |
Answered by
kettanaito
Jan 17, 2026
Replies: 1 comment 1 reply
|
Hi, @binarykitchen. This sounds a lot like Storybook not serving the Note that you can also use the official add-on that has a tighter integration into Storybook. |
1 reply
Answer selected by
kettanaito
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, @binarykitchen.
This sounds a lot like Storybook not serving the
./publicdirectory. I believe that doesn't happen automatically. You have to configure it to serve that folder. You can learn more here Mocking Network Requests > The MSW add-on.Note that you can also use the official add-on that has a tighter integration into Storybook.