Issue
When ever I attempt importing tosify into react:
Using the following:
import { ToastContainer, toast } from 'react-toastify'; import 'react-toastify/dist/ReactToastify.css';
I get the following error:
Failed to compile.
./node_modules/react-toastify/dist/react-toastify.esm.mjs Can't import the named export 'cloneElement' from non EcmaScript module (only default export is available)
Not sure what solution is and have spent alot time trying to find solution but I am unable too, if anything else is needed let me know but when the tosify import not there the site works fine.
Solution
I solved by updating my node version and react version,
npm install --save react@latest npm install -g npm-check-updates npm audit fix --force
Answered By - Clinton
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.