why do I get an error in react-toastify module? - reactjs

I'm using react-toastify to pop up an error message. Why do I get this error?
TypeError: Object(...) is not a function
useToastContainer
E:/Courses/programing/Code with Mosh/Front End/Mastering React/08 - Calling Backend Services (01h42m)/Section 8- Calling Backend Services/start/http-app/node_modules/react-toastify/dist/react-toastify.esm.js:866
Once I remove ToastContainer component everything works normally. What should I do to get rid of this error, and why do I get it?

I got the same problem here, I guess we are both using the newest version of react-toastify, but after I change the version with 4.1 (which the instructor is using) and it solved !
First, you need :
npm uninstall react-toastify --save
Then, reinstall it with the version 4.1
npm i react-toastify#4.1

Building on Pelic's answer, after uninstalling the latest version and reinstalling version 4.1, i had to restart my VSCode to get it to work!

Related

How to solve error when install react-animated-3d-card

When I want react-animated-3d-card, I get an error with Npm when I install it
How can i fix this errors?
The package react-animated-3d-card requires react version 16 as stated in the error log. The only way to use it in your project is to downgrade react to version 16. Your current react version is 18.

TypeError: Cannot set property 'reactRoot' of undefined

I'm developing a frontend for my API using Next JS and Typescript. I have made changes to the code that has caused this a Type Error to occur whenever I attempt to build, run in dev mode or lint.
Usually this would be fairly easy to debug - however the type error is not present in my own files but instead Next JS's:
Any help would be appreciated.
Thanks in advance!
The issue was caused by a version mismatch between react-dom and the other NextJS packages - I'd removed react-dom as a dependency as I was unaware that NextJS depended on it, so when it was added again it downloaded the latest version "^18.0.0" instead of "17.0.2".
Remove next and reinstall it. It will install the latest version of next and correct react version.
npm uninstall next
npm install next

Why there occurs an error while I tried to install packages using npm

I am working in react js . While installing packages I got the following error as shown in the image. I tried many ways but nothing becomes right. How can I solve this issue?IMAGE OF ERROR
you havn't installed python yet
So install python !
Still problem persist then try
npm cache clean --force

mauron85 background-geolocation installation issues (react-native: command not found)

hope you can help. I'm trying to install mauron85 react-native-background-geolocation and when i go to link the dependencies (react-native link react-native-mauron85-background-geolocation) i keep getting 'react-native: command not found'. i've installed npm, nodejs, react native (npm install -g react-native-cli), flow, watchman and the mauron85 package. i'm running this on ubuntu and have tried on mac and getting the same error message on both. I've also tried doing the manual setup for android and this hasn't worked because I don't have some of the node modules it needs, and have tried adding the right path to my path variable, which has made no difference. Is there anything obvious I'm missing that I've forgotten to install/has anyone had a similar message before?
Thanks!

Can not install angular-cli on mac Elcapitan

when I try to install angular-cli I see so many warnings and after this when i type
ng --version it shows :
MDSAZIDs-iMac:~ MYMAC$ ng --version
fs.js:640
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
TypeError: path must be a string or Buffer
at TypeError (native)
at Object.fs.openSync (fs.js:640:18)
at Object.fs.readFileSync (fs.js:508:33)
at Function.Version.fromProject (/usr/local/lib/node_modules/angular-cli/upgrade/version.js:87:31)
at Function.Version.isPreWebpack (/usr/local/lib/node_modules/angular-cli/upgrade/version.js:111:31)
at Function.Version.assertPostWebpackVersion (/usr/local/lib/node_modules/angular-cli/upgrade/version.js:97:18)
at /usr/local/lib/node_modules/angular-cli/bin/ng:25:15
at /usr/local/lib/node_modules/angular-cli/node_modules/resolve/lib/async.js:44:21
at ondir (/usr/local/lib/node_modules/angular-cli/node_modules/resolve/lib/async.js:187:31)
at /usr/local/lib/node_modules/angular-cli/node_modules/resolve/lib/async.js:153:39
MDSAZIDs-iMac:~ MYMAC$
I dont what is the problem can anyone tell me..????
This seems similar to the issue on ubuntu.
error while creating new project with Angular-cli
Can you post this issue on github? https://github.com/angular/angular-cli/issues
Edit:
can you try to use npm install -g webpack before installing angular-cli. (as sudo/root please)
This fixed my problem! :)
I tried in many ways but nothing was working for me then i installed windows 7 in a vertual machine and then installed latest nodejs on that windows 7 .then through npm I installed angular-cli and every thing is working well on that windows 7 :)
Upadate:
I have found this tutorial which has totaly solved my problem
https://www.youtube.com/watch?v=4mtlrXYKsZ0&index=1&list=PLrMggSuNOco6iLjrCOsO1_UKmJQosr7_g

Resources