storybookjs/storybook
[Bug]: Cannot read properties of undefined (reading 'custom') in Next.js project
Aperta
#21.911 aperta il 4 apr 2023
bughelp wantednextjssev:S3
Metriche repository
- Star
- (89.909 stelle)
- Metriche merge PR
- (Merge medio 7g 22h) (184 PR mergiate in 30 g)
Descrizione
Describe the bug
The issue started in https://github.com/storybookjs/storybook/releases/tag/v7.0.0-beta.29 and I suspect it might be related to https://github.com/storybookjs/storybook/pull/20615
To Reproduce
Check https://github.com/storybookjs/status-page
Go to feat/upgrade-storybook
This has a workaround
The way to work around this issue is to customize webpack to mock out assert:
import type { StorybookConfig } from '@storybook/nextjs';
const config: StorybookConfig = {
// ...
webpackFinal: async (config) => {
config.resolve = config.resolve || {};
config.resolve.alias = {
...config.resolve.alias,
// Mock assert to avoid issues like Cannot read properties of undefined (reading 'custom')
assert: false,
};
return config;
},
};
export default config;
System
No response
Additional context
No response