storybookjs/storybook
在 GitHub 查看[Bug]: Cannot read properties of undefined (reading 'custom') in Next.js project
Open
#21,911 创建于 2023年4月4日
bughelp wantednextjssev:S3
仓库指标
- Star
- (89,909 star)
- PR 合并指标
- (平均合并 7天 22小时) (30 天内合并 184 个 PR)
描述
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