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

Capture errors leads to a message about --allow-console-errors #156

Closed
tmeasday opened this issue Jul 11, 2020 · 3 comments
Closed

Capture errors leads to a message about --allow-console-errors #156

tmeasday opened this issue Jul 11, 2020 · 3 comments
Assignees
Labels
customer reported Tracking: This issue was reported through customer support planned Tracking: Issue is tracked internally small Estimate: <= 1 day (> 2 hours)

Comments

@tmeasday
Copy link
Member

tmeasday commented Jul 11, 2020

If your build has component/story errors, the output is:

Chromatic CLI v5.0.0
https://www.chromatic.com/docs/cli

  ✔ Authenticated with Chromatic
    → Using project token '*******1fim'
  ✔ Retrieved git information
    → Commit '5d2ec3d' on branch 'next'; found 1 baseline commit
  ✔ Collected Storybook metadata
    → Storybook v6.0.0-beta.9 for React; supported addons found: Actions, Backgrounds, Docs, Links, Storyshots, Viewport
  ✔ Storybook built in 15 seconds
    → View build log at /Users/tom/Chroma/chromatic/examples/simple-app/build-storybook.log
  ✔ Publish complete in 15 seconds
    → View your Storybook at https://5a2777b5ac397a00201ccd82-ulbsaigmwu.chromatic.com
  ✔ Started build 617
    → View build details at https://www.chromatic.com/build?appId=5a2777b5ac397a00201ccd82&number=617
  ✔ Build 617 failed after 7 seconds
    → Found 3 errors (1 component, 2 stories, 5 snapshots); exiting with status code 2

ℹ Speed up Continuous Integration
Your project is linked to GitHub so Chromatic will report results there.
This means you can pass the --exit-once-uploaded flag to skip waiting for build results.
Read more here: https://www.chromatic.com/docs/cli#chromatic-options

✖ Encountered 3 build errors: failing with exit code 2
Pass --allow-console-errors to succeed this command regardless of runtime build errors.

A few things here:

  • --allow-console-errors used to (when we used JSDOM) mean that we'd continue even if we observed errors logged in the JS console when gathering a story list (i.e. at load time). The reason we had that behaviour in the first place (stopping if we saw console errors), was due to console errors many times leading to people's Storybooks not loading properly, and us capturing an incomplete Storybook, which is a bad experience in Chromatic.
  • Do we still stop on console errors now we get the story list w/ puppeteer? I think we probably should for the reason above (and because we are much less likely to get spurious console errors which happened a lot due to JSDOM). I think we lost this functionality in translation.
  • In any case --allow-console-errors shouldn't have anything to do with the above errors which are render-time "capture" errors. Passing the flag shouldn't change the behaviour in this case, and if it does it should be named differently (--exit-zero-on-errors would be consistent with --exit-zero-on-changes).
  • Finally, did we decide to call this kind of error a "build error"? ("Encountered 3 build errors"). This seems confusing as these are errors for specific components/stories, rather than errors at the build level, e.g. during building or at load time.

┆Issue is synchronized with this Asana task by Unito

@tmeasday tmeasday added bug Classification: Something isn't working customer reported Tracking: This issue was reported through customer support labels Jul 11, 2020
@piperchester
Copy link

Thanks for opening @tmeasday!

@tmeasday tmeasday added this to the Q3 Backlog milestone Jul 16, 2020
@tmeasday tmeasday added small Estimate: <= 1 day (> 2 hours) planned Tracking: Issue is tracked internally labels Sep 25, 2020
@tmeasday tmeasday modified the milestones: Q2 Improvements, Q3 Backlog Apr 1, 2021
@tmeasday tmeasday modified the milestones: Q3 Backlog, Q3 Improvements Jun 30, 2021
@tmeasday tmeasday added planned Tracking: Issue is tracked internally and removed planned Tracking: Issue is tracked internally labels Jun 30, 2021
@ghengeveld
Copy link
Member

ghengeveld commented Jan 10, 2022

Since we no longer have JSDOM, the whole concept of a "runtime error" can be removed, and the --allow-console-errors flag should be removed as well, since it doesn't do anything anymore.

We could add --exit-zero-on-errors if that's something people need, but that would be a separate feature request.

@ghengeveld ghengeveld removed the bug Classification: Something isn't working label Jan 10, 2022
@paulelliott
Copy link
Member

We'll do this as part of #1115

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer reported Tracking: This issue was reported through customer support planned Tracking: Issue is tracked internally small Estimate: <= 1 day (> 2 hours)
Projects
None yet
Development

No branches or pull requests

4 participants