question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Don't continue if the storybook throws an error

See original GitHub issue

What

In order to avoid roadbumps we decided to ignore logged errors when evaluating your story list and getting a list of stories (sometimes people’s code logs errors but it’s not actually an issue).

We should re-evaluate this behaviour or add a flag to opt-into it.

Why

Often errors are logged when evaluating story files (if there’s a JS bug in one of the files). What this means (e.g this build at this url) is that we end up getting a truncated list of stories (all the ones that evaluated before the error was thrown).

Chromatic does not make you accepted deleted stories (which is a tricky problem actually) and this leads to a bad time.

However, some users have stuff logged to their error console as a matter of course and can’t necessarily remove it easily. So we still need a way to opt out.

How

  1. Let’s change the default behaviour to cancel the build if there’s something logged to the error console.

  2. Let’s add a flag --allow-console-errors that reverts to the current behaviour

  3. In the case of 1., let’s say something like: “Your Storybook logged the following to the error console while loading. Errors loading your Storybook can lead to Chromatic getting your list of stories wrong and can cause a variety of problems. If you want to continue even with the errors, pass the --allow-console-errors flag to the chromatic command, however we do not recommend it.”

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
tmeasdaycommented, Jan 23, 2020

Also --allow-console-errors doesn’t appear to work.

0reactions
tmeasdaycommented, Jan 24, 2020

Maybe I’m forgetful but I don’t remember us having this argument. I’m not seeing any reference to it in the entire repo.

It’s at the top of this ticket – we were going to add this flag to allow continuing the build even if the storybook outputs errors.


The current behaviour isn’t right btw – what I posted here is a bug.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Console Addon | Storybook: Frontend workshop for UI ...
There're some cases when you can't / don't want / forgot to keep browser console opened. This addon helps you to get all...
Read more >
How are you supposed to get useful errors in Storybook?
On my storybook, I use React with Typescript. If ... Useful error. When clicking on the link, it open the sources panel in...
Read more >
How to use the @storybook/node-logger.logger.error function ...
Handler = (err, stats) => { if (err) { logger.error(err. ... throw new Error('no-headless-browser-running'); } expect.assertions(1);.
Read more >
Running JavaScript with Templates in Storybook for HTML
When working with Storybook for HTML, it can be difficult to pair a ... to run a module <script> in the browser will...
Read more >
How I solved and debugged my Webpack issue through trial ...
No wonder it can easily become a troublesome task to debug when something ... If we try to backtrace the origin of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found