devrnt / react-use-intercom

☎️ React Intercom integration without the hassle, powered by hooks.
https://devrnt.github.io/react-use-intercom/#/useIntercom
MIT License
337 stars 43 forks source link

TypeError: Object(...) is not a function #99

Closed jovanimal closed 4 years ago

jovanimal commented 4 years ago

Describe the bug I've installed react-use-intercom in several modules that I previously worked on but this time, it throws such error when I try to to insert <IntercomProvider> in the highest level. I'm wondering if it has anything to do with other dependencies.

image

Additional context My installation code (hide appId for privacy purpose) image

My package.json

image

devrnt commented 4 years ago

Thanks for your report.

react-use-intercom makes use of hooks internally, these were introduced in React 16.8.0. Since your React version is 16.6.3 it won't work, that's why we add "react": ">=16.8.0" in the peerDependencies.

jovanimal commented 4 years ago

@devrnt It works fine after I updated react to latest version which is 16.13.1!

I didn't think it was because of react version in the first place because I'd successfully installed Intercom in another module which has the version 16.6.3 using react-use-intercom.

The package.json file from another module. image

devrnt commented 4 years ago

Seems strange, I've no explanation for that. Maybe you have a local package link for react.