Closed kettanaito closed 2 years ago
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/mswjs/msw-storybook-addon/4BsS5TeT29SHLmBuoKptPpakW6gp
✅ Preview: https://msw-storybook-addon-git-fix-worker-script-404-mswjs.vercel.app
To start, I'm updating the worker script to be aligned with the latest installed msw
. That shouldn't affect how the script is fetched in any way, though.
The worker script is never present in the storybook-static
dir, which is the server app's root. We need to respect NextJS's public
directory during the build.
The build-storybook
command we were using was referring to the build-storybook
binary. Since we called it without any options in the root-level yarn build
, it never copied the Next's public
dir to its static dir.
Fixing this to refer to our own custom storybook-build
command.
Attempts to resolve the following runtime error that, supposedly, happens when fetching the worker script: