ReduxSimpleStarter icon indicating copy to clipboard operation
ReduxSimpleStarter copied to clipboard

React-router error

Open adharbert opened this issue 7 years ago • 6 comments
trafficstars

I'm not sure what the error is, but when I installed react-router it isn't working. I get the same error over and over on the new site, if I remove imports for react-router I am able to see the page, but once I log back in, I get the following error:

bundle.js:86 Uncaught ReferenceError: Provider is not defined at Object. (bundle.js:86) at webpack_require (bundle.js:20) at Object. (bundle.js:47) at webpack_require (bundle.js:20) at bundle.js:40 at bundle.js:43

Any ideas why this would be an issue?

Thanks!

adharbert avatar May 09 '18 03:05 adharbert

I've encountered another error with react-router "Uncaught TypeError: Cannot read property 'func' of undefined". It was fixed by updating to [email protected] as for me. I'm not sure, but maybe it will fix your problem too.

maximsan avatar May 09 '18 08:05 maximsan

Thanks for the response, I tried that last night as well but still have the error. I might blow the project away and start from scratch, it might be a bad download or something.

adharbert avatar May 09 '18 10:05 adharbert

Please type this command in your command prompt npm dist-tag ls react-router.

Will find this below output: $ npm dist-tag ls react-router latest: 4.1.1 next: 4.0.0 previous: 3.0.5 $ npm dist-tag ls react-router-dom latest: 4.1.1 next: 4.0.0-beta.8 . So based on this we could install latest version like npm install --save [email protected].

Might be with this update your issue will get resolved.

nagarajach avatar May 09 '18 12:05 nagarajach

Have the same issue as adharbert. Fixed by updating to [email protected] as maximsan said.

monastyrskiiden avatar May 24 '18 11:05 monastyrskiiden

Also, you could consider installing react-router-dom instead of react-router, it seems to be the way to go regarding routing. I used only that dependency and did not encounter any problems

David2913 avatar Jun 21 '18 16:06 David2913

Thanks @maximsan for sharing this. I thought that I would never finish this course because of this stupid bug.

shrimpdoom1920 avatar Aug 01 '18 06:08 shrimpdoom1920