storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
84.08k stars 9.25k forks source link

Webpack: Fix export 'act' (imported as 'React4') was not found in 'react' errors in webpack #29235

Open kasperpeulen opened 19 hours ago

kasperpeulen commented 19 hours ago

What I did

In wepback the following error is thrown when act doesn't exist in React: export 'act' (imported as 'React4') was not found in 'react' errors in webpack

We do check if act exists, but webpack will still throw an error on compile time

Cloning the react module avoid this problem.

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

Manual testing

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

Checklist for Maintainers

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

_core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>_

github-actions[bot] commented 19 hours ago
Fails
:no_entry_sign: PR is not labeled with one of: ["cleanup","BREAKING CHANGE","feature request","bug","documentation","maintenance","build","dependencies"]
:no_entry_sign: PR is not labeled with one of: ["ci:normal","ci:merged","ci:daily","ci:docs"]

Generated by :no_entry_sign: dangerJS against 1c4cd916e899b494ea1ad745b21e012e2eb6fb85

nx-cloud[bot] commented 19 hours ago

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 1c4cd916e899b494ea1ad745b21e012e2eb6fb85. 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 - [`nx run-many -t build --parallel=3`](https://cloud.nx.app/runs/VY0ZVtpyB4?utm_source=pull-request&utm_medium=comment)

Sent with 💌 from NxCloud.