-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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: Fix react-native-reanimated is not installed! error #2953
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
hey! thank you for the PR, good stuff! I think it looks kinda weird with the |
There might be a problem if we create a proxy for React element module. If we want to support React element module, the solution might be a bit more complicated. |
For almost all cases, we can return import React from 'react'
import { Text } from 'react-native'
const Hello = () => <Text>Hello, world</Text>
module.exports = React.memo(Hello) we should return |
Hm I don't think we'll ever have such modules, but I'm not sure if that's the case. Do you prefer |
852b6c8
to
d2761c8
Compare
In that case, I think overwriting |
This is really a weird fix, I hope this is the right solution forward. I don't know what side-effects will be introduced if we override Either way, LGTM - thank you so much for your contribution and explanation on this!! |
What
This PR fixes the errors
react-native-reanimated is not installed!
,@shopify/react-native-skia is not installed!
, andreact-native-worklets-core is not installed!
that occur when inlineRequires is disabled inmetro.config.js
(enabled by default).When
inlineRequires
is enabled, there are no errors because all modules are loaded lazily.When
inlineRequires
is disabled, there is an attempt to read the property$$typeof
at start time from a module created viacreateModuleProxy
, which causes an error.Changes
This PR changes
createModuleProxy
to return an object that contains the proxy instead of returning the proxy directly. This prevents unnecessary access to the proxy.We could, for instance, add a check only for the
$$typeof
property, but I think the proxy doesn't need to be aware of this property. Additionally, I'm not sure if it will work if we create a proxy for a react element module.Tested on
Related issues
Minimal reproducible example: https://github.com/mgefimov/vision-camera-inline-requires-error
react-native-vision-camera
, setup camera code