Home > database >  import "react-toastify/dist/ReactToastify.css";
import "react-toastify/dist/ReactToastify.css";

Time:12-13

C:\Users\User\Documents\GitHub\zampliasurveys_frontend\node_modules\react-toastify\dist\ReactToastify.css:1 ({"Object.":function(module,exports,require,__dirname,__filename,jest){:root { ^

SyntaxError: Unexpected token ':'

   6 | import { Footer } from "components/Footer/Footer";
   7 | import { ToastContainer } from "react-toastify";
>  8 | import "react-toastify/dist/ReactToastify.css";
     | ^
   9 |
  10 | export const Layout = () => {
  11 |   return (

  at Runtime.createScriptFromCode (node_modules/react-scripts/node_modules/jest-runtime/build/index.js:1728:14)
  at Object.<anonymous> (src/pages/Layout/index.tsx:8:1)
  at Object.<anonymous> (src/AppRoutes.tsx:9:1)
  at Object.<anonymous> (src/App.tsx:1:1)
  at Object.<anonymous> (src/__test__/App.test.tsx:3:1)

CodePudding user response:

make sure you have installed all dependencies.. run after doing

npm install

in terminal

CodePudding user response:

Just need to add the foolowing configuration in package.json, below dev dependencies.

"transformIgnorePatterns": [
      "node_modules/(?!(axios|react-toastify))"
],

//This the way how you can make eslint ignore syntax related to a dependency

  • Related