storybook: In v6.1.6 storybook react no longer loads. It generates a bad bundle name
Describe the bug
In v6.1.6 storybook react builds but no longer loads in the browser. It generates a bad bundle name
Reverting back to 6.1.4 fixes the problem
To Reproduce
Upgrade a React project that is working under Storybook 6.1.4 and run storybook and you get a blank browser page.
In the console it says
HTTP error: status code 404 could not load http://localhost:6006/xxxblah.bundle.js
Expected behaviour
I expected the storybook to load
System
Environment Info:
System: OS: macOS 10.15.7 CPU: (16) x64 Intel® Xeon® W-2140B CPU @ 3.20GHz Binaries: Node: 14.15.1 - ~/.nvm/versions/node/v14.15.1/bin/node Yarn: 1.22.10 - /usr/local/bin/yarn npm: 6.14.8 - ~/.nvm/versions/node/v14.15.1/bin/npm Browsers: Chrome: 87.0.4280.67 Safari: 14.0.1 npmPackages: @storybook/addon-actions: ^6.1.6 => 6.1.6 @storybook/addon-essentials: ^6.1.6 => 6.1.6 @storybook/addon-links: ^6.1.6 => 6.1.6 @storybook/node-logger: ^6.1.6 => 6.1.6 @storybook/preset-create-react-app: ^3.1.5 => 3.1.5 @storybook/react: ^6.1.6 => 6.1.6
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 31 (11 by maintainers)
I tried all of the suggestion above, didn’t work. Then flushing the browser cache fixed it for me… Wow.
Can you try running with
--no-manager-cache?Okay I just tried upgrading my project to 6.1.9. Starting up storybook gave the same issue as before - a malformed bundle name (or at least a different bundle hash to the one the system is looking for). Starting it up again however with
--no-manager-cachefixes the problem.Once it works then dropping the
--no-manager-cacheagain works fine, but I’ll need to leave it in there for now as other members of the team will also hit the same issue and I’d rather the update just worked invisibly.EDIT: Clearing my browser cache solved the issue. Not sure why, but it seems like storybook doesn’t look at the new main.[hash].bunder.js file when the hash changes.
I’m encountering this issue in a way that doesn’t seem to be related to upgrading storybook. After running
npm run storybook(with and without --no-manager-cache flag), I get a blank page with this logged to the console:Storybook stuff from package.json (this has not changed):
"scripts: { ... "storybook": "start-storybook -p 6006", "build-storybook": "build-storybook" }"devDependencies": {"@storybook/addon-actions": "^6.1.14","@storybook/addon-essentials": "^6.1.14","@storybook/addon-links": "^6.1.14","@storybook/react": "^6.1.14",main.js:
module.exports = {stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],addons: ['@storybook/addon-links', '@storybook/addon-essentials'],};preview.js:
import MyTheme from '@myTheme';import { ThemeProvider } from '@material-ui/core/styles';export const parameters = {actions: { argTypesRegex: '^on[A-Z].*' },};export const decorators = [(Story) => (<ThemeProvider theme={MyTheme}><Story /></ThemeProvider>),];Another piece of the puzzle is that, if I run
npm installin a feature branch that does not have this issue and then switch over to the problem feature branch without runningnpm install, storybook runs fine, even though the package.json files are identical. I hit the bug only after running npm install, so it feels like there is some weirdness related to that process. I have already tried deleting node_modules, which did not help.Just tried again with v6.1.7.
node_modules/.cachefolder.running
npm run storybookIt builds okay
but in the browser I just get a blank page.
In the console I see:
The bundle hash is not the same as any of the hashes that the page attempts to load.
.storybook/main.js.storybook/preview.jsnpm run storybookfull outputRunning now on 6.3.12 on a fresh install (NextJS, TS, Tailwind, Storybook), but doesn’t work. Also non of the workarounds mentioned in this thread unfortunately.
No errors in the terminal
some in the console;
Same for
6.4.13. Clearing cache does not help.Same issues for me sadly 😕
Egads!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.3.0-alpha.44 containing PR #14993 that references this issue. Upgrade today to the
@nextNPM tag to try it out!Closing this issue. Please re-open if you think there’s still more to do.
Just hit this on an upgrade to 6.1.18 and this did the trick for me as well.
@fllprbt Did you trash
node_modulesand try again? Please create a new ticket for6.4.13and elaborate on your exact problem if this is indeed a regression. The issue at hand is closed.I just want to add that @davesag tip worked for me. After I had did the npx upgrade as suggeted, my storybook dev server was looking for a main.xxx.js bundle that wasn’t there. (404) - Once u ran storybook with the suggested tag I was able to get my SB back.
@ghengeveld I can confirm that fixes the issue 🙏 Thanks again
Same issue after upgrading. My
package.jsonlooks like:Reverting to
6.1.5fixes the issue.