Intellij IDEA Ultimate - React App debugger exception
Answered
Hi,
I have Intellij IDEA Ultimate IDE (2020.2.4) and I created a new React App project using npx create-react-app.
npm version is 6.14.9 and node.js version is v14.15.1.
After adding all the needed files I executed "npm start" and the pages ran successfully on chrome.
However, when I try to debug the app I encounter a few problems.
I added to package.json the following property:
"type": "module",
but now I get another error:
SyntaxError: Unexpected token '<'
I don't understand why I get it, without debugging using "npm start" the web page works well.
Looks like something related to Debugger configuration.
** When I use VsCode for debugging (instead on IntelliJ) everything works as expected.
Does anyone know how I can fix it ?
Please sign in to leave a comment.
It can hardly be related to debugger... I can't reproduce the issue with provided steps. What do you debug - your React application code or npm script the server is started with? What code the error is reported against? Please share a screenshot of the console with the error.
tells
nodeto treat files ending in.jsas ES modules when passed tonodeas the initial input, or when referenced byimportstatements within ES module code; do you have any special reason for making the code executed withnode(i.e. react scripts in case of application created with CRA) treated this way?