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

Use import.meta.webpackHot instead of module.hot for check #19686

Merged
merged 1 commit into from
Nov 2, 2022

Conversation

halkeye
Copy link
Contributor

@halkeye halkeye commented Oct 29, 2022

Issue: "Uncaught TypeError: importMeta.webpackHot is undefined"

What I did

Updated the template to check if importMeta.webpackHot exists before trying to use it.

How to test

  • Is this testable with Jest or Chromatic screenshots?
  • Does this need a new example in the kitchen sink apps?
  • Does this need an update to the documentation?

If your answer is yes to any of these, please make sure to include it in your PR.

I don't seem to see any tests that test this sort of thing i'd need to update. And I'm not sure why i'd have module.hot instead of import.meta.webpackHot, as I thought that was a webpack 5 change. But it made sense to me to check if what you are using exists.

@halkeye
Copy link
Contributor Author

halkeye commented Oct 29, 2022

I don't think the failed test not being able to install yarn is related to my PR

@ndelangen
Copy link
Member

@halkeye what base-branch did you use for this PR?

When I try to update this PR with the next branch (the default branch, and the target) it's 1100+ commits behind, and it won't allow me to push to your remote because:

> git push halkeye use-import-meta:use-import-meta
To https://github.com/halkeye/storybook.git
 ! [remote rejected]       use-import-meta -> use-import-meta (refusing to allow an OAuth App to create or update workflow `.github/workflows/generate-repros-next.yml` without `workflow` scope)
error: failed to push some refs to 'https://github.com/halkeye/storybook.git'

@halkeye
Copy link
Contributor Author

halkeye commented Nov 2, 2022

I thought i was using next.

image

I'll reset and re-submit, its only one line

@ndelangen ndelangen added the maintenance User-facing maintenance tasks label Nov 2, 2022
@ndelangen
Copy link
Member

Thank you so much @halkeye 👏👏👏

@ndelangen ndelangen merged commit 319ec81 into storybookjs:next Nov 2, 2022
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.

2 participants