gardencmp / jazz

A new way to build apps with distributed state.
https://jazz.tools
MIT License
313 stars 13 forks source link

jazz packages not available on Obsersable #202

Open devgru opened 1 month ago

devgru commented 1 month ago

Trying to probe jazz-react or jazz-browser fails on Observable platform.

I've checked using Tom MacWright's module debugger.

I've tried to replicate the problem locally using packd and from the logs it looks like the problem might be in crypto libraries.

'node:crypto' is imported by .tmp/72c7fdc7693293db071a588091d794e76d42546b/package/node_modules/cojson/dist/crypto/WasmCrypto.js, but could not be resolved – treating it as an external dependency
'@scure/bip39' is imported by .tmp/72c7fdc7693293db071a588091d794e76d42546b/package/dist/auth/PassphraseAuth.js, but could not be resolved – treating it as an external dependency
packd error [jazz-browser] Unexpected token Error: Unexpected token
    at error (/Users/devgru/Peers/LocalFirst/packd/node_modules/rollup/dist/shared/node-entry.js:5400:30)
    at Module.error (/Users/devgru/Peers/LocalFirst/packd/node_modules/rollup/dist/shared/node-entry.js:9824:16)
    at tryParse (/Users/devgru/Peers/LocalFirst/packd/node_modules/rollup/dist/shared/node-entry.js:9717:23)
    at Module.setSource (/Users/devgru/Peers/LocalFirst/packd/node_modules/rollup/dist/shared/node-entry.js:10080:33)
    at /Users/devgru/Peers/LocalFirst/packd/node_modules/rollup/dist/shared/node-entry.js:12366:20
    at async Promise.all (index 19)
    at async Promise.all (index 0)
    at async Promise.all (index 3)
    at async Promise.all (index 0)
    at async Promise.all (index 0)
devgru commented 1 month ago

Actually, looking inside packd error reveals that the problem is in completely different place, one of the files in effect package:

.../packd/.tmp/72c7fdc7693293db071a588091d794e76d42546b/package/node_modules/effect/dist/esm/Data.js

Screenshot 2024-05-31 at 15 31 05

That makes me wonder whether effect is rollup-compatible or the problem is somewhere deeper.