How to fix TypeError _interopRequireDefault is not a function in Create React App

Viewed 7799

I'm trying to use Create React App on Codesandbox.io but I keep receiving TypeError _interopRequireDefault is not a function import ReactDOM from "react-dom";

Please let me know how I can fix this, thank you.

3 Answers

In my case the solution was to clean jest cache:

npx jest --clearCache

After add "@babel/runtime", I fixed it

Add @babel/runtime to the dependency section. That will fix it.

Related