Reputation: 1343
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.
Upvotes: 29
Views: 22487
Reputation: 11
I used flowbite-react a library of tailwind and while they have given
import Link from 'next/link';
for Navbar code just replace this with
import { Link } from "react-router-dom";
problem would be solvd
Upvotes: 1
Reputation: 11
Add the below dependency in your main package.json file to solve that issue.
"@babel/runtime": "^7.15.4", "metro-react-native-babel-preset": "^0.69.0",
Upvotes: 1
Reputation: 747
In my case the solution was to clean jest
cache:
npx jest --clearCache
Upvotes: 57
Reputation: 61
Add @babel/runtime
to the dependency section. That will fix it.
Upvotes: 6