-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[storybook] Ignore TS-related HMR warnings #103605
[storybook] Ignore TS-related HMR warnings #103605
Conversation
21b698e
to
e016f7e
Compare
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this.
You can also remove the warningsFilter
from the stats config (https://github.com/elastic/kibana/blob/master/packages/kbn-storybook/webpack.config.ts#L22), which suppressed these warnings in the terminal output. I tried it and with your changes the warnings don't show up in either the terminal or the browser.
jenkins test this |
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
💔 Backport failed
To backport manually run: |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
1 similar comment
Friendly reminder: Looks like this PR hasn’t been backported yet. |
* [storybook] Ignore TS-related HMR warnings * Fix casing * Remove warnings filter Co-authored-by: Kibana Machine <[email protected]>
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
* [storybook] Ignore TS-related HMR warnings * Fix casing * Remove warnings filter Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Kibana Machine <[email protected]>
Summary
Storybook uses HMR out-of-the-box when you run it locally, and so it outputs a ton of warnings that specific types aren't actually exported.
This ends up burying other valid warnings. In Canvas, for example, there was a warning that a story wasn't working properly, drowned out by a massive, irrelevant HMR warning.
Looking around, I came across this comment on an issue that led me to a common solution: a webpack plugin that suppresses that warning in the log.
After:
There's a NPM module that uses this strategy with an optional RegEx, but I didn't think we needed to add another dependency to handle a one-off warning in Storybook.
Comments welcome...!