Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Object is not a function #180

Open
besshehu opened this issue Apr 21, 2023 · 2 comments
Open

TypeError: Object is not a function #180

besshehu opened this issue Apr 21, 2023 · 2 comments

Comments

@besshehu
Copy link

besshehu commented Apr 21, 2023

Screenshot 2023-04-22 at 12 06 35 AM

I get the above error when trying to use the QRCode React Function.

I imported it like this:
import QRCode from 'react-native-qrcode-svg';

and used it like this:
Screenshot 2023-04-22 at 12 12 29 AM

When running on ios simulator i get the following error: TypeError: Object is not a function

The dependencies list:
"dependencies": {
"react": "18.2.0",
"react-native": "0.71.6",
"react-native-qrcode-svg": "^6.2.0",
"react-native-svg": "^13.9.0",
},

Does anyone have an idea why this is happening?

@cheukyin21hk
Copy link

I got the same problem when i am trying to upgrade my project with latest expo version. But i don't have any idea why does it happen..

@cheukyin21hk
Copy link

In my case, The problem is that when encodeUtf8(data) is called in /lib/core/byte-data.js (inside the qrcode folder) will pop this error message.
I guess there are somethings changed to make the bahaviour of require state in line 1 have changed.
and the encodeUtf8 is expected to be a function, but now it is a object {default:function}. therefore it causes that error in my code. Hope this could provide any useful for speeding up the troubleshoot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants