Can't resolve component error in CRA
See original GitHub issueI am having trouble getting MDX (0.2.8) to work with CRA (react-scripts 2.1.8) and React (16.8.6). I am using Node 10.1.0. (Just updated to 11.13.0, problem persists)
I keep getting the error:
Can't resolve './MyComponent' in '...node_modules/.cache/mdx.macro/MyComponent.84dc28b7ef.mdx.js'
despite it being in the same dir?
Not sure if it is related but I also get a loop of errors in iTerm immediately after it fails:
node[50284] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-21)
until it eventually errors too many times and halts the output to the terminal.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Can't resolve module (not found) in React.js - Stack Overflow
It seems you need import Header from './components/header/header' w/o src. File path is relative to importing file path. Then you need to export ......
Read more >Module not found: Can't resolve 'X' error in React | bobbyhadz
To solve the "Module not found: Can't resolve" error in React, make sure to install the package from the error message if it's...
Read more >How to fix module not found: can't resolve in React
The solution for this case is to set the correct path of the component and in our case, the path will be ./components/header....
Read more >How to fix 'Module not found: Can't resolve 'http' in ... - YouTube
Your browser can't play this video. ... How to fix 'Module not found: Can't resolve 'http' in ...' error with FCL + React....
Read more >Strict Mode - React
Identifying components with unsafe lifecycles; Warning about legacy string ref ... hazard where you can't change the implementation details of a component ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
A better solution would be using react-app-rewired or craco. Let’s see if I can get it up and running.
Thanks @dreadwail for your response! Today I was struggling with the same error! The docs of mdxjs.com are still showing the old path to use
mdx.macro
with CRA and MDX.But I don’t have confidence to replace
react-scripts
withreact-scripts-mdx
.What happens with the updates on
react-scripts
that are not present inreact-scripts-mdx
?