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: Cannot read property "require" of undefined #55

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RZulfikri
Copy link

Hi I found an issue that spam our sentry and development screens.
After few testing on this liblary I found that mapLoadable[name] can be undefined. So when you extract with const {require, loader, ...} = mapLoadable[name] it will trow an error.

const { require: load, loader, ...rest } = mapLoadable[name];

I'm trying to fix this by adding condition on top of that code, by cheking mapLoadable[name] exist, before extract the value.

prevent undefined value
@RZulfikri
Copy link
Author

here is the error that I found, cc @kirillzyusko

Simulator Screen Shot - iPhone 14 Pro Max - 2023-02-23 at 00 59 28

@kirillzyusko kirillzyusko self-requested a review February 24, 2023 10:41
@kirillzyusko
Copy link
Owner

Hi @RZulfikri

Thanks for submitting a PR!

Could you please say, how it's possible to call getComponent when it hasn't been registered yet? 🤔
I think something is wrong with the code of your app...

Would be great if you could provide a minimal reproduction example of the issue 😊

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

Successfully merging this pull request may close these issues.

2 participants