[expo-modules-core] Ensure uuid.v4 and uuid.v5 imports available on old architecture#33621
Conversation
uuidv4 and uuidv5 is available on old react native architecture.uuidv4 and uuidv5 imports available on old architecture
uuidv4 and uuidv5 imports available on old architectureuuid.v4 and uuid.v5 imports available on old architecture
Contributor
|
Subscribed to pull request
Generated by CodeMention |
Kudo
requested changes
Dec 12, 2024
Contributor
Kudo
left a comment
There was a problem hiding this comment.
hi there! thanks for the fix. could you help to run the following command the build js files? that would help to resolve the check-packages ci error
$ cd packages/expo-modules-core
$ yarn prepare
Contributor
Author
@Kudo done! |
Kudo
approved these changes
Dec 12, 2024
Contributor
Kudo
left a comment
There was a problem hiding this comment.
thanks again for having the fix!
entiendoNull
pushed a commit
to entiendoNull/expo
that referenced
this pull request
Dec 13, 2024
…on old architecture (expo#33621) # Why It seems that `globalThis?.expo?.uuidv4` is undefined on iOS when this module is loaded. As a result, when trying to call `uuid.v4` later in the code, it keeps throwing `Native UUID version 4 generator implementation wasn't found in 'expo-modules-core'` even though `globalThis?.expo?.uuidv4` at that point is available. I'm assuming in new architecture `globalThis?.expo?.uuidv4` is set synchronously, so this would not be an issue. In old architecture however, it would be best to reference this value when executing `v4` or `v5` calls themselves. # How Use direct reference to `globalThis?.expo?.uuidv4` from inside `uuidv4()` functions to avoid referencing a stale value.
gaearon
added a commit
to bluesky-social/social-app
that referenced
this pull request
Dec 16, 2024
gaearon
added a commit
to bluesky-social/social-app
that referenced
this pull request
Dec 16, 2024
* Fix duplicate expo-modules-core * Patch expo/expo#33621
tsapeta
pushed a commit
that referenced
this pull request
Dec 16, 2024
…on old architecture (#33621) # Why It seems that `globalThis?.expo?.uuidv4` is undefined on iOS when this module is loaded. As a result, when trying to call `uuid.v4` later in the code, it keeps throwing `Native UUID version 4 generator implementation wasn't found in 'expo-modules-core'` even though `globalThis?.expo?.uuidv4` at that point is available. I'm assuming in new architecture `globalThis?.expo?.uuidv4` is set synchronously, so this would not be an issue. In old architecture however, it would be best to reference this value when executing `v4` or `v5` calls themselves. # How Use direct reference to `globalThis?.expo?.uuidv4` from inside `uuidv4()` functions to avoid referencing a stale value.
Signez
pushed a commit
to Signez/bsky-social-app
that referenced
this pull request
Dec 26, 2024
* Fix duplicate expo-modules-core * Patch expo/expo#33621
Contributor
|
Hello ! I also have this problem in version 51.0.39. Would it be possible to port this fix to version 51? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
It seems that
globalThis?.expo?.uuidv4is undefined on iOS when this module is loaded. As a result, when trying to calluuid.v4later in the code, it keeps throwingNative UUID version 4 generator implementation wasn't found in 'expo-modules-core'even thoughglobalThis?.expo?.uuidv4at that point is available.I'm assuming in new architecture
globalThis?.expo?.uuidv4is set synchronously, so this would not be an issue. In old architecture however, it would be best to reference this value when executingv4orv5calls themselves.How
Use direct reference to
globalThis?.expo?.uuidv4from insideuuidv4()functions to avoid referencing a stale value.Test Plan
On iOS the error stops being thrown when calling
uuid.v4within a component.Checklist
changelog.mdentry and rebuilt the package sources according to this short guidenpx expo prebuild& EAS Build (eg: updated a module plugin).