sai
sai

Reputation: 46

While trying to start react app i am facing the below error and it is not compiling why?

I got a notification in vs-code to activate tc(type-script) and i activated it. After that when i am trying to run basic example app(npx create-react-app my-app) given in the react docs, i am facing the below error. Can any one tell the best way to overcome this issue?

./src/index.js 1:77
    Module parse failed: Unexpected token (1:77)
    File was processed with these loaders:
     * ./node_modules/@pmmmwh/react-refresh-webpack-plugin/loader/index.js
     * ./node_modules/babel-loader/lib/index.js
    You may need an additional loader to handle the result of these loaders.
    > $RefreshRuntime$ = require('E:/ReactJS preparation(GD)/ReactProject with API's/my-app/node_modules/react-refresh/runtime.js');
    | $RefreshSetup$(module.id);
    |

Upvotes: -1

Views: 2587

Answers (2)

SamHeyman
SamHeyman

Reputation: 254

Yes, Guillermo is right, you are seeing this error because of the path of the file:

E:/ReactJS preparation(GD)/ReactProject with API

the spaces are preventing the file to be accessed correctly. I had a similar issue with ' in the name.

Upvotes: -1

Guillermo Brachetta
Guillermo Brachetta

Reputation: 4775

The problem could be in the way you named your folder, including spaces and apostrophe (the ' in API's).

Upvotes: 2

Related Questions