You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importReactfrom'./node_modules/react';constAppointments=()=>{return(<div>
This is an ultra simple component
</div>);};exportdefaultAppointments;
The output in the console when I run npm start:
Failed to compile.
./src/user/components/Appointments.js
Module not found: Can't resolve './node_modules/react' in '<path-to-project>/client/src/user/components'
Successful compilation when calling another component from a component
Actual behavior
Outputs compilation error:
Failed to compile.
./src/user/components/Appointments.js
Module not found: Can't resolve './node_modules/react' in '<path-to-project>/client/src/user/components'
Hello,
I'm going crazy with this issue.
I tried everything I can find, but the suggestions do not work.
Thanks for helping.
Project sample here
Describe the bug
Started the application with npx create-react-app client
This is my project structure:
src/Dashboard.js
Appointments.js
The output in the console when I run
npm start
:I Did recover my dependencies. I'm using npm.
I did:
Then:
And it didn't fixed my project
Searches in Google and in the User Guide?
Can't resolve './node_modules/react'
Answers found:
Which does not apply to my case.
My paths are correct, I done the project recovery, I have ./node_modules/react, react is on my dependencies
Environment
I'm running macOS Catalina Version 10.15.4
After running
npx create-react-app --info
:Steps to reproduce
Expected behavior
Successful compilation when calling another component from a component
Actual behavior
Outputs compilation error:
Reproducible demo
Project sample here
The text was updated successfully, but these errors were encountered: