Skip to content

TypeError: Cannot read property "require" of undefined#55

Open
RZulfikri wants to merge 1 commit intokirillzyusko:masterfrom
RZulfikri:master
Open

TypeError: Cannot read property "require" of undefined#55
RZulfikri wants to merge 1 commit intokirillzyusko:masterfrom
RZulfikri:master

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