React-native: uuid not working when debugger is disabled
See original GitHub issueDescribe the bug
In my react-native application, I am using:
import { uuidv4 } from 'uuid';
uuidv4()
The uuid get generated successfully when the app is running on debug
mode (The debugger is enabled). However, if you turn off the debugger, it does not work, as soon as the app reaches uuidv4()
line of code, it stops there without any error in the console.
How to reproduce
npx react-native init AwesomeProject
yarn install uuid
import { uuidv4 } from 'uuid';
uuidv4()
- Test the app, should not work
ctrl + d
to open the developer menu, selectDebug
- It will start working as normal
Expected behavior
The app should work as normal in both debug
mode being enabled and disabled.
Runtime
System:
OS: macOS 10.15.7
CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
Memory: 392.40 MB / 8.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 14.15.0 - ~/.nvm/versions/node/v14.15.0/bin/node
Yarn: 1.22.4 - ~/Documents/youpendo-app-bareworkflow/node_modules/.bin/yarn
npm: 6.14.8 - ~/.nvm/versions/node/v14.15.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.1, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
Android SDK:
API Levels: 28, 29
Build Tools: 28.0.3, 29.0.2
System Images: android-28 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 3.6 AI-192.7142.36.36.6392135
Xcode: 12.1/12A7403 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_232 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: ^4.8.0 => 4.13.0
react: 16.13.1 => 16.13.1
react-native: 0.63.3 => 0.63.3
Additional information
[Any other information or comments that you think will help]
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Debugger Unavailable : Debugging is not currently supported ...
Is there any workaround while waiting for an official support to debug javascript in the new React Native architecture? react-native.
Read more >React native app only works with debug enabled? - Reddit
Seems to be happening on both iOS simulator and iOS device. When debug is not enabled, it loads up, stays at 100% with...
Read more >JavaScript - Docs - PostHog
This will enable debugging, easily allowing you to see all data that is being sent to PostHog. Development. For instructions on how to...
Read more >How to use the react-native-firebase.storage function in ... - Snyk
UUIDGenerator.getRandomUUID((uuid) => { consolelog(`DEBUG firebase/uploadReport(), uuid=${uuid}`); let refName = chosenCity; refName = refName.replace(/[^a-z0-9 ...
Read more >Announcing React Native 0.69
On React Native 0.69, React 18 is enabled by default. However, if you have not migrated to the New Architecture, you will only...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oops. I stopped reading the example code after
import
because I saw that the polyfill was missing… But you are obviously right, @broofa, in addition to the missing polyfill it must also read:Just like in the documentation: https://github.com/uuidjs/uuid#react-native--expo
Did you follow the documentation and install
react-native-get-random-values
?