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

fix: make expo modules work #293

Merged
merged 2 commits into from
Dec 11, 2024
Merged

fix: make expo modules work #293

merged 2 commits into from
Dec 11, 2024

Conversation

zetavg
Copy link
Collaborator

@zetavg zetavg commented Dec 11, 2024

Key error message

undefined is not a function (it is undefined)

Root cause

In node_modules/expo-modules-core/build/NativeViewManagerAdapter.native.js, there's the following code:

import * as NativeComponentRegistry from 'react-native/Libraries/NativeComponent/NativeComponentRegistry';

// ...

function requireNativeComponent(viewName) {
    return NativeComponentRegistry.get(viewName, () => {
// ...

In the RN bundle, it's being transformed into:

// ...
function requireNativeComponent(viewName) {
    return undefined(viewName, () => {
// ...

Because the virtual virtual:rn-internals:react-native/Libraries/NativeComponent/NativeComponentRegistry module doesn't properly define named exports, thus Rollup thinks NativeComponentRegistry.get must be undefined.

Copy link

railway-app bot commented Dec 11, 2024

This PR was not deployed automatically as @zetavg does not have access to the Railway project.

In order to get automatic PR deploys, please add @zetavg to your team on Railway.

@zetavg zetavg marked this pull request as ready for review December 11, 2024 15:19
@zetavg zetavg merged commit ef6a6c8 into main Dec 11, 2024
12 checks passed
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.

1 participant