question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't resolve component error in CRA

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
DaniGuardiolacommented, Jul 7, 2020

A better solution would be using react-app-rewired or craco. Let’s see if I can get it up and running.

0reactions
Canopixcommented, Apr 23, 2020

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 usemdx.macro with CRA and MDX.

But I don’t have confidence to replace react-scripts with react-scripts-mdx.
What happens with the updates on react-scripts that are not present in react-scripts-mdx?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found