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

UUID Generation in Non-Browser Context (eg. NativeScript) #556

Closed
BallisticPain opened this issue Feb 2, 2021 · 2 comments
Closed

UUID Generation in Non-Browser Context (eg. NativeScript) #556

BallisticPain opened this issue Feb 2, 2021 · 2 comments

Comments

@BallisticPain
Copy link

Is your feature request related to a problem? Please describe.

When I import and use uuid in a NativeScript application I receive an error cannot get 'browser' of undefined. Initially I didn't realize this was related to the UUID library. But the moment I removed attempted v4() generation the application compiled without any errors.

Describe the solution you'd like

I would love to use uuid as per the documentation even when in a mobile device situation such as NativeScript. I saw the ReactNative support and was hopeful. However, upon a quick peek it didn't seem to be a user friendly solution and I didn't want to attempt to port it.

Describe alternatives you've considered

I've looked at guid-typescript, however, it is unmaintained even though it's downloaded 67k+ times per week according to NPM.

Another alternative that I have considered is to write a NativeScript plugin that uses Android / iOS functionality to generate the UUIDs but felt that would only benefit a smaller community.

Additional context

I imagine if the solution were implemented very well it could cross all the non-browser contexts. I'm not certain how feasible this is, but I hope this is the right place to ask.

Thanks for this UUID library!

@broofa
Copy link
Member

broofa commented Feb 2, 2021

Duplicate of #314.

@BallisticPain - A Minimal, Complete, and Verifiable example, ⟪cough⟫ as requested in the bug report template ⟪cough⟫ would be helpful. E.g. a small repo that we can clone, with instructions for building and reproducing the error.

@ctavan
Copy link
Member

ctavan commented Feb 6, 2021

@BallisticPain please check my comment in #314 (comment)

If reordering resolve.mainFields doesn't work for you, feel free to reopen this issue and proved an example as outlined by @broofa above.

@ctavan ctavan closed this as completed Feb 6, 2021
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

3 participants