Closed CaptainN closed 5 months ago
If I run a storybook build, then run that - I get this error:
Cannot read properties of undefined (reading 'custom')
TypeError: Cannot read properties of undefined (reading 'custom')
at ./node_modules/assert/build/internal/assert/assertion_error.js (http://127.0.0.1:8080/5943.94865f7a.iframe.bundle.js:404:191427)
at __webpack_require__ (http://127.0.0.1:8080/runtime~main.628485a3.iframe.bundle.js:1:381)
at ./node_modules/assert/build/assert.js (http://127.0.0.1:8080/5943.94865f7a.iframe.bundle.js:404:165662)
at __webpack_require__ (http://127.0.0.1:8080/runtime~main.628485a3.iframe.bundle.js:1:381)
at ./node_modules/console-browserify/index.js (http://127.0.0.1:8080/5943.94865f7a.iframe.bundle.js:404:252160)
at __webpack_require__ (http://127.0.0.1:8080/runtime~main.628485a3.iframe.bundle.js:1:381)
at ./node_modules/next/dist/compiled/react-dom/index.js (http://127.0.0.1:8080/5943.94865f7a.iframe.bundle.js:404:688784)
at __webpack_require__ (http://127.0.0.1:8080/runtime~main.628485a3.iframe.bundle.js:1:381)
at ./node_modules/next/dist/compiled/react-dom/client.js (http://127.0.0.1:8080/5943.94865f7a.iframe.bundle.js:404:688505)
at __webpack_require__ (http://127.0.0.1:8080/runtime~main.628485a3.iframe.bundle.js:1:381)
If I follow the workaround in #21911 it doesn't help with dev mode, but does seem to get unbroken stories to load after build:
config.resolve = config.resolve || {};
config.resolve.alias = {
...config.resolve.alias,
// Mock assert to avoid issues like Cannot read properties of undefined (reading 'custom')
assert: require.resolve('browser-assert'),
};
Dev mode still doesn't work though.
Hi @CaptainN
Can you provide a reproduction? https://storybook.new
Weird, it was just the presence of this file in my source tree:
src/util/index.ts:
export function withGlobalProps(pageProps) {
return {
globalProps: {},
...pageProps,
};
}
It wasn't even being imported by anything
Hi there! Thank you for opening this issue, but it has been marked as stale
because we need more information to move forward. Could you please provide us with the requested reproduction or additional information that could help us better understand the problem? We'd love to resolve this issue, but we can't do it without your help!
I'm afraid we need to close this issue for now, since we can't take any action without the requested reproduction or additional information. But please don't hesitate to open a new issue if the problem persists – we're always happy to help. Thanks so much for your understanding.
Describe the bug
Storybook won't load any stories - I get this runtime error:
To Reproduce
I'm really not sure, but here are my configs:
.storybook/main.js:
preview-head.html
System
Additional context
No response