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

Doesn't work with react-native #9

Open
bkniffler opened this issue Jan 23, 2019 · 5 comments
Open

Doesn't work with react-native #9

bkniffler opened this issue Jan 23, 2019 · 5 comments

Comments

@bkniffler
Copy link
Contributor

Hey, this library works nice in node/browser. But unfortunately not with react-native, since there is no global Buffer element. Replacing that part with require('buffer').Buffer works.

So maybe this could be changed to something along: let buffer = typeof Buffer !== 'undefined' ? Buffer : require('buffer').Buffer;?

@mcollina
Copy link
Owner

We can easily do a require('buffer').Buffer instead. Would you like to send a PR?

@bogacg
Copy link

bogacg commented Jan 11, 2022

I'm getting an error:

hyperid.js:64 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'from')
    at baseId (hyperid.js:64:25)

which might be related.
It's a SvelteKit project (Vite).

@DanielRuf
Copy link

Leads to the following error now, when building with webpack:

ERROR in ./node_modules/hyperid/hyperid.js 5:13-37
Module not found: Error: Can't resolve 'buffer' in '/home/druf/Schreibtisch/projects/bitexpert/3-CMS/assets/headless/node_modules/hyperid'

@mcollina
Copy link
Owner

mcollina commented May 3, 2023

Would you like to send a Pull Request to address this issue? Remember to add unit tests.

@DanielRuf
Copy link

@mcollina there is #31 but it was closed (not sure why).

Unfortunately I have no time to provide a PR so we switched to nanoid.

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

4 participants