nostr package: get tests passing in the browser #490

Merged
sistemd merged 3 commits from nostr-package-browser-tests into main 2023-04-17 13:34:33 +00:00
sistemd commented 2023-04-05 23:05:15 +00:00 (Migrated from github.com)

I can now truly call it an isomorphic library: it does in fact work in the browser as well as node. Will implement NIP-07 next.

I can now truly call it an isomorphic library: it does in fact work in the browser as well as node. Will implement NIP-07 next.
cloudflare-pages[bot] commented 2023-04-05 23:06:32 +00:00 (Migrated from github.com)

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5f29ae0
Status:   Deploy successful!
Preview URL: https://1861e914.snort-social.pages.dev
Branch Preview URL: https://nostr-package-browser-tests.snort-social.pages.dev

View logs

## Deploying with &nbsp;<a href="https://pages.dev"><img alt="Cloudflare Pages" src="https://user-images.githubusercontent.com/23264/106598434-9e719e00-654f-11eb-9e59-6167043cfa01.png" width="16"></a> &nbsp;Cloudflare Pages <table><tr><td><strong>Latest commit:</strong> </td><td> <code>5f29ae0</code> </td></tr> <tr><td><strong>Status:</strong></td><td>&nbsp;✅&nbsp; Deploy successful!</td></tr> <tr><td><strong>Preview URL:</strong></td><td> <a href='https://1861e914.snort-social.pages.dev'>https://1861e914.snort-social.pages.dev</a> </td></tr> <tr><td><strong>Branch Preview URL:</strong></td><td> <a href='https://nostr-package-browser-tests.snort-social.pages.dev'>https://nostr-package-browser-tests.snort-social.pages.dev</a> </td></tr> </table> [View logs](https://dash.cloudflare.com/?to=/:account/pages/view/snort-social/1861e914-58fe-456a-ac43-c97dc147ff08)
v0l commented 2023-04-07 17:17:42 +00:00 (Migrated from github.com)

Module not found: Error: Can't resolve '@snort/nostr' in '/opt/buildhome/repo/packages/app/src'

`Module not found: Error: Can't resolve '@snort/nostr' in '/opt/buildhome/repo/packages/app/src'`
sistemd commented 2023-04-08 20:35:32 +00:00 (Migrated from github.com)

So after dealing with more nonsense from a broken ecosystem, the tests now pass but only on node versions larger than 16.

The root cause is that the uuid package is trying to use crypto.getRandomValues in tests. I don't know why it doesn't use node's crypto module instead. I don't want to know; it's part of the legacy code, and I don't think that trying to fix this is worth the time.

So after dealing with more nonsense from a broken ecosystem, the tests now pass but only on node versions larger than 16. The root cause is that the `uuid` package is trying to use `crypto.getRandomValues` in tests. I don't know why it doesn't use node's `crypto` module instead. I don't want to know; it's part of the legacy code, and I don't think that trying to fix this is worth the time.
v0l (Migrated from github.com) approved these changes 2023-04-10 11:03:09 +00:00
Sign in to join this conversation.
No description provided.