question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

error in react-toastify/libs/index.js:1 when running tests

See original GitHub issue

Since upgrading to version 4.2.0 to version 4.2.2, when I run tests with ts-jest I get the following error :

 /home/arhia/Documents/projects/payroll-app-next/client/node_modules/react-toastify/lib/index.js:1

 ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import ToastContainer from './components/ToastContainer';

  ^^^^^^^^^^^^^^
    
    SyntaxError: Unexpected identifier

ToastContainer seems properly exported/imported in that file, so I don’t understand the meaning of this error.

Our configuration : “react-toastify”: “4.2.2”, “react-scripts”: “1.1.5” “react-app-rewire-typescript”: “2.0.2”, “react-app-rewired”: “1.5.2”,

Could someone provide some hints ?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
abenhamdinecommented, Aug 29, 2018

thx a lot ! 👍 💃

0reactions
fkhadracommented, Aug 29, 2018

@abenhamdine the issue is fixed now.

👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Toastify React, error when attempting to use - Stack Overflow
I get the following error: Failed to compile. ./node_modules/react-toastify/dist/react-toastify.esm.mjs Can't import the named export ...
Read more >
react-toastify - npm
Latest version: 9.1.1, last published: 2 months ago. Start using react-toastify in your project by running `npm i react-toastify`.
Read more >
[Solved]-React JS: ERROR in index.css 1:0 (Module parse failed
Coding example for the question React JS: ERROR in index.css 1:0 (Module parse failed: Unexpected token (1:0))-Reactjs.
Read more >
react-toastify.esm.mjs can't import the named export ... - You.com
My project was working correctly 100% until today when I started my development environment and it gave me a bunch of errors. The...
Read more >
What is React Tostify: Types, Features, Installation and more
Now, let's test run it by showing a toast on the screen… Also, note that react toastify has a react native toastify version...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found