Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to start Storybook after upgrading from 6.4.22 -> 6.5.3 #18280

Closed
corymharper opened this issue May 19, 2022 · 6 comments
Closed

Unable to start Storybook after upgrading from 6.4.22 -> 6.5.3 #18280

corymharper opened this issue May 19, 2022 · 6 comments

Comments

@corymharper
Copy link

Describe the bug
When running start-storybook, after the manager builds it just waits indefinitely.

To Reproduce
I've not been able to reproduce this in the minimal repo yet. The context I'm seeing it in is a large monorepo in its microservices.

System
Environment Info:

System:
OS: macOS 12.2.1
CPU: (10) arm64 Apple M1 Max
Binaries:
Node: 16.13.0 - /usr/local/bin/node
Yarn: 3.1.1 - /usr/local/bin/yarn
npm: 8.1.0 - /usr/local/bin/npm
Browsers:
Chrome: 101.0.4951.64
Edge: 101.0.1210.47
Firefox: 99.0.1
Safari: 15.3

Additional context
I thought it might be related to the dependency errors mentioned in #18278 because I saw them as well, so I injected pollyfills for the missing node packages into the manager's webpack and resolved those errors, but that didn't fix it. It might be worth mentioning that we use yarn workspaces and yarn plug'n'play. Here's the part of the package.json related to Storybook:

		"@storybook/addon-actions": "^6.5.3",
		"@storybook/addon-essentials": "^6.5.3",
		"@storybook/builder-webpack5": "^6.5.3",
		"@storybook/manager-webpack5": "^6.5.3",
		"@storybook/node-logger": "^6.5.3",
		"@storybook/preset-create-react-app": "^4.1.0",
		"@storybook/react": "^6.5.3",

and here's our main.js:

const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');

module.exports = {
	stories: ['../src/components/**/*.stories.tsx'],
	addons: [
		'@storybook/preset-create-react-app',
		{
			name: '@storybook/addon-essentials',
			options: {
				backgrounds: false,
			},
		},
		'storycap',
	],
	core: {
		builder: 'webpack5',
	},
	webpackFinal: async (config) => {
		config.resolve = {
			...config.resolve,
			symlinks: false,
		};
		
		config.plugins = [...config.plugins, new NodePolyfillPlugin()];
		
		return config;
	},
	managerWebpack: async (baseConfig) => {
		baseConfig.plugins = [...baseConfig.plugins, new NodePolyfillPlugin()];

		return baseConfig;
	},
};

Lastly, here's the output from start-storybook with the debug-webpack flag (its extremely long so I put it in a Google doc):

https://docs.google.com/document/d/1EdEPz7on_LH6xtduMK5P6-o4l3ERuDO5zHKsb4XmFk0/edit?usp=sharing

After that last line, nothing happens, it just sits there indefinitely.

@minnocci-bcgdv
Copy link

Similar situation here, with the same packages, the first breaking error for me is:

ERR! ModuleNotFoundError: Module not found: Error: Can't resolve 'util' in '/home/runner/work/frontend/frontend/node_modules/@storybook/ui/dist/esm'

@corymharper
Copy link
Author

corymharper commented May 20, 2022

@minnocci-bcgdv You can resolve that particular error with the plugin you see in the main.js file I pasted above, or by providing a fallback yourself. The stalling will persist afterwards however if you have the same problem as me.

@marcelgerber
Copy link

I am also running into this issue.
The util import is happening in the ESM build of the @storybook/router package, see here: https://cdn.jsdelivr.net/npm/@storybook/router@6.5.4/dist/esm/index.js (just Cmd-F for util in there)

@ndelangen
Copy link
Member

Looks like there's a work around for the util problem (ERR! ModuleNotFoundError: Module not found: Error: Can't resolve 'util' in '/home/runner/work/frontend/frontend/node_modules/@storybook/ui/dist/esm'), but @minnocci-bcgdv is reporting an issue where the preview build is just 'hanging' forever.

I'll look at the util being missing problem today, but I have no way to reproduce the 'infinite hanging' problem you're describing @minnocci-bcgdv
If you could try to create a minimal reproduction for me, then I can take a look.

@ndelangen
Copy link
Member

Looks like the utils issue is already resolved in 6.5.x, based on this work:
https://github.com/storybookjs/storybook/pull/18412/files

I can see the CI on the main branch succeed for CRA + pnp:
https://app.circleci.com/pipelines/github/storybookjs/storybook/26612/workflows/4a885968-bcc1-4a45-9eef-a174c8c4b96b/jobs/386657

@shilman
Copy link
Member

shilman commented Jun 9, 2023

We’re cleaning house! Storybook has changed a lot since this issue was created and we don’t know if it’s still valid. Please open a new issue referencing this one if:

@shilman shilman closed this as not planned Won't fix, can't repro, duplicate, stale Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants