Create file called .babelrc in your root directory and add this code
{ "presets": ["next/babel"], "plugins": [] }
And in .eslintrc replace the existing code with
{ "extends": ["next/babel"] }
Hopefully my notes can help you with your software development
Create file called .babelrc in your root directory and add this code
{ "presets": ["next/babel"], "plugins": [] }
And in .eslintrc replace the existing code with
{ "extends": ["next/babel"] }
Possible Problems
You run npx create-react-app my-app
and it only tells you npx installed without generating a new project.
You successfully create a new React project but there’s no server.js file in the project. It may give you this error when you run npm start
: “missing script: start”
Solution
Installing create-react-app globally is now discouraged. Instead uninstall globally installed create-react-app package by doing:
npm uninstall -g create-react-app
Then, just try creating a new React project:
npx create-react-app my-app
Restart your Mac.