-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Open
Labels
affects demosbuginternal-qaThis issue was reported by the Storybook team, potentially on unreleased or prerelease software.This issue was reported by the Storybook team, potentially on unreleased or prerelease software.ui
Description
Describe the bug
When code in the Storybook Manager UI breaks, such as: foo.bar = 10 where foo is undefined, Storybook crashes completely into a white screen. This has happened a few times in different places in Storybook, most recently (though already fixed) when registering new shortcuts on MacOS and using special characters.
The experience of the crash is the following:

The ideal solution has to be discussed with the team, we should add a global error boundary and provide a helpful error UI (perhaps notifications, similar to VSCode?)
Reproduction link
Reproduction steps
An easy way to reproduce this error is by using a custom .storybook/manager.ts file with code that will break, e.g.:
import { addons, type State } from 'storybook/manager-api'
addons.setConfig({
layoutCustomisations: {
showToolbar(state: State, defaultValue: boolean) {
if (state.storyId?.includes('button')) {
throw new Error('Boom')
}
return true
},
},
})System
-Additional context
No response
dosubot
Metadata
Metadata
Assignees
Labels
affects demosbuginternal-qaThis issue was reported by the Storybook team, potentially on unreleased or prerelease software.This issue was reported by the Storybook team, potentially on unreleased or prerelease software.ui