Very useful article @iamandrewluca
. I was able to get my Nx app running with MSW without any issues. Also got Jest to recognize MSW.
However, having trouble with Storybook. It seems to find the handlers but has trouble loading mockServiceWorker.js. Here's the error message:
Any idea what could be going wrong? Here's my repo. yarn storybook:app to start storybook, then try CartView or CatalogView. You will see "Network Error".
When your run storybook, it starts standalone without app/lib configuration even if is run through nx.
Your current configuration is specifically for react-test-shop.
You will need to configure msw separately for storybook I think. Take a look at this addon, maybe it will help
Thanks for your response, Andrew. I will take a look. Without Nx in the picture, I have never had to do anything more than starting MSW from .storybook/preview.tsx. For example, in this repo I have the same app working with CRA and Storybook and everything works just fine!!!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Very useful article @iamandrewluca . I was able to get my Nx app running with MSW without any issues. Also got Jest to recognize MSW.
However, having trouble with Storybook. It seems to find the handlers but has trouble loading
mockServiceWorker.js
. Here's the error message:Any idea what could be going wrong? Here's my repo.
yarn storybook:app
to start storybook, then try CartView or CatalogView. You will see "Network Error".TIA.
When your run storybook, it starts standalone without app/lib configuration even if is run through nx.
Your current configuration is specifically for react-test-shop.
You will need to configure msw separately for storybook I think. Take a look at this addon, maybe it will help
storybook.js.org/addons/msw-storyb...
Thanks for your response, Andrew. I will take a look. Without Nx in the picture, I have never had to do anything more than starting MSW from
.storybook/preview.tsx
. For example, in this repo I have the same app working with CRA and Storybook and everything works just fine!!!