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

Release 2.1.11 did not include fix for react-native #185

Closed
eugenemlee opened this issue Mar 20, 2020 · 3 comments
Closed

Release 2.1.11 did not include fix for react-native #185

eugenemlee opened this issue Mar 20, 2020 · 3 comments

Comments

@eugenemlee
Copy link

Using nanoid on RN throws an error saying react native does not have a built-in secure random generator. This is with import 'react-native-get-random-values'; included as well.

image

Notice that the error message is different from index.browser.js in 9b44531 that was supposed to fix the issue. I had a look at the nanoid package in my node_modules and index.browser.js is missing code from the commit.

if (
    typeof navigator !== 'undefined' &&
    navigator.product === 'ReactNative' &&
    !self.crypto  // <--- this is missing
  ) {
...

Perhaps this needs to be re-released on npm?

Thanks!

@ai
Copy link
Owner

ai commented Mar 20, 2020

Thanks for the report. Yeap, we are making big refactoring right now.

I will release this fix this week. I will ping you to test a new release.

@ai
Copy link
Owner

ai commented Mar 22, 2020

Can you help me with React Native and my new TS/ESM release system in Nano Events?
ai/nanoevents#44

I will release new Nano ID, which I will polish my TS/ESM system on other projects.

@ai
Copy link
Owner

ai commented Mar 26, 2020

The fix was released in Nano ID 3.0

@ai ai closed this as completed Mar 26, 2020
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

No branches or pull requests

2 participants