-
-
Notifications
You must be signed in to change notification settings - Fork 936
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
Module not found: Can't resolve 'react-refresh/runtime' in create-react-app v4 #2957
Comments
Looks like it's new to CRA 4.0 from a few days ago You can disable the injection of
You could also fix it by adding a dependency |
Why pnpm does not install this dependency? It seems to be declared on webpack's package.json |
pnpm does install it. It's just not hoisted to
|
Will be fixed upstream in facebook/create-react-app#9872 |
Issue
Versions affected
|
Tem um bug acontecendo aqui, o react-scripts não está detectando o react-refresh mesmo já estando instalado. Já tem um PR aberto no create-react-app para corrigir isso. pnpm/pnpm#2957 (comment)
The current create-react-app does not work with pnpm See pnpm/pnpm#2957
I noticed a typo above. It should be FAST_REFRESH and not FAST_REFESH. |
Fixed. Thanks 🙌 |
Because of the way pnpm installs `node_modules` on disk, the app didn't have the ability to load `react-refresh`. We fixed this in the other apps by installing `react-refresh` at the top level of the application, and the same fix works here. See pnpm/pnpm#2957
react-refresh is a dependency of remix-dev, not of your app. so we can use require.resolve to find it. This fixes an issue where remix-dev would not work with pnpm. see pnpm/pnpm#2957 (comment) for a similar issue in CRAv4 and how they fixed it there https://github.com/pmmmwh/react-refresh-webpack-plugin/pull/230/files Signed-off-by: Logan McAnsh <logan@mcan.sh>
react-refresh is a dependency of remix-dev, not of your app. so we can use require.resolve to find it. This fixes an issue where remix-dev would not work with pnpm. see pnpm/pnpm#2957 (comment) for a similar issue in CRAv4 and how they fixed it there https://github.com/pmmmwh/react-refresh-webpack-plugin/pull/230/files Signed-off-by: Logan McAnsh <logan@mcan.sh>
pnpm version:
5.10.2
Code to reproduce the issue:
Expected behavior:
app compiles successfully
Actual behavior:
getting error Module not found: Can't resolve 'react-refresh/runtime'
Additional information:
node -v
prints: v12.19.0The text was updated successfully, but these errors were encountered: