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

Webpack: Hide runtime errors #23175

Merged
merged 6 commits into from
Mar 26, 2024
Merged

Conversation

donaldpipowitch
Copy link
Contributor

Work-in-progress

Closes #

What I did

Storybook shows runtime errors by default in an error overlay. As React in dev-mode is re-throwing actually handled errors, this can get very confusing. If I understood correctly Storybook is not using webpack-dev-server, so we can't specify this config in user land in main.js. If I'm not mistaken this has to be passed as a query param to the dev middleware instead.

How to test

Checklist

  • Make sure your changes are tested (stories and/or unit, integration, or end-to-end tests)
  • Make sure to add/update documentation regarding your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Maintainers

  • If this PR should be tested against many or all sandboxes,
    make sure to add the ci:merged or ci:daily GH label to it.
  • Make sure this PR contains one of the labels below.

["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]

@ndelangen
Copy link
Member

@donaldpipowitch how do I test this?

Can you supply links to documentation & explaining the intend of the change?

Is this PR still a "Work-in-progress"? I'll make it a draft PR, so it won't come up in our triage until it's ready, I hope you don't mind.

I tested this in a codespace, and it looked fine, but honestly couldn't really determine if any really changed; hence my question above.

@ndelangen ndelangen marked this pull request as draft July 5, 2023 11:16
@ndelangen ndelangen changed the title hide runtime errors Webpack: Hide runtime errors Jul 5, 2023
@donaldpipowitch
Copy link
Contributor Author

Thanks for asking @ndelangen.
I'll probably add an example for a documented error boundary in Storybook. This should illustrate the problem quite well: if you're working on some error boundary and want to document it in storybook you'll likely throw some artificial error somewhere. In the development mode this is currently picked up as a runtime error from the webpack error overlay, which makes it hard to properly work on it.

@ndelangen ndelangen changed the base branch from next to release-8-0 November 27, 2023 09:23
@ndelangen
Copy link
Member

@yannbf I'm wondering what you think of this change; considering you've worked on webpack error handling (with me) before.

@donaldpipowitch
Copy link
Contributor Author

FYI: Since creating this MR we switched to vite. I'd also be fine with closing this MR.

But maybe it would in general be nice to add more error boundary examples to Storybook to cover some edge cases better (the test runner also had "problems" with error boundaries that is tracked in an issue).

@github-actions github-actions bot deleted the branch storybookjs:next November 28, 2023 23:23
@github-actions github-actions bot closed this Nov 28, 2023
@JReinhold JReinhold reopened this Nov 29, 2023
@JReinhold JReinhold changed the base branch from release-8-0 to next November 29, 2023 08:03
@ndelangen ndelangen marked this pull request as ready for review March 26, 2024 09:30
Copy link

nx-cloud bot commented Mar 26, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 4981436. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@ndelangen ndelangen merged commit 0f7cddd into storybookjs:next Mar 26, 2024
56 checks passed
@github-actions github-actions bot mentioned this pull request Mar 26, 2024
22 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants