When testing some code for ipfs-shipyard/helia-service-worker-gateway, we saw the following error:
heliaFetch.ts:106 fs.stat error for cid 'QmbSa3mkSjwTX32feHXC9yMZ6TVH2JzJdR5sHyzssJueLB' and path '/' TypeError: globalThis.postMessage is not a function
at Object.readLock (browser.ts:67:16)
at storage.ts:108:41
at Generator.next (<anonymous>)
at asyncGeneratorStep (pins.ts:189:4)
at _next (pins.ts:189:4)
at pins.ts:189:4
at new Promise (<anonymous>)
at pins.ts:189:4
at BlockStorage.get (storage.ts:125:6)
at unixFsResolver (index.ts:32:34)
When testing some code for ipfs-shipyard/helia-service-worker-gateway, we saw the following error:
coming from https://github.com/achingbrain/mortice/blob/0eab826e744c8bc23ac65d17ac3a44e5f4694a3d/src/browser.ts#L67
We should move away from postMessage to BroadcastChannel and MessageChannel which should be supported in all browser contexts and node after v15.