1

When I am trying to test the default test of create-react-app. It gave me an error of ES6 compilation of ES6 import. I don't have any transpiler like babel in my code. Do I need to use .babelrc to transpile the code?

FAIL src\app\App.test.js ● Test suite failed to run

C:\Users\ritesh\Desktop\AelerUI\aeler-web\node_modules\react-router-dom\es\NavLink.js:7
import React from "react";
^^^^^^
SyntaxError: Unexpected token import

  at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/ScriptTransformer.js:289:17)
  at Object.<anonymous> (src/component/LeftNavbar/LeftNavbar.js:7:16)
  at Object.<anonymous> (src/App.js:5:19)

1 Answers1

0

Did you use npm i before ? Maybe packages aren't donwloaded.

CyrilHskt
  • 93
  • 1
  • 7