0
Failed to compile

./src/index.js 1:39 Module parse failed: Unexpected token (1:39) 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('C:/Users/I'm-cx0140/Desktop/dreact/node_modules/react-refresh/runtime.js'); | $RefreshSetup$(module.id); | This error occurred during the build time and cannot be dismiss

my package.json

{
  "name": "myapp",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.13.0",
    "@testing-library/react": "^11.2.7",
    "@testing-library/user-event": "^12.8.3",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-scripts": "4.0.3",
    "web-vitals": "^1.1.2"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

    enter code here
{
  "name": "myapp",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.13.0",
    "@testing-library/react": "^11.2.7",
    "@testing-library/user-event": "^12.8.3",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-scripts": "4.0.3",
    "web-vitals": "^1.1.2"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}
3
  • Would you mind posting your Babel config? Or is this a create-react-app application? If not you likely need to configure @babel/preset-react and @babel/preset-env. Commented Jun 2, 2021 at 18:42
  • Please add your configuration files. Like package.json, babel config, Commented Jun 4, 2021 at 8:15
  • i have only package.json not babel config Commented Jun 4, 2021 at 14:40

2 Answers 2

3

Removing the " ' " from my foldername work for me. change I'm-cx0140 to something like Im-cx0140

Sign up to request clarification or add additional context in comments.

Comments

0

The ' character in your user name (I'm-cx0140) can trigger this issue, create your project in another folder.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.