You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to integrate the 301.js example from the Helia 101 example repo with a Nuxt3 project I ran into problems using Helia in a TypeScript context.
Lines 50 & 51 in the return statement of createHelia both datastore & blockstore are throwing similar but different errors.
Type 'MemoryDatastore' is not assignable to type 'Datastore<{}, {}, {}, {}, {}, {}, {}, {}, {}, {}>'.
The types of 'batch().put' are incompatible between these types.
Blockstore error:
Property 'getAll' is missing in type 'MemoryBlockstore' but required in type 'Blockstore<{}, {}, {}, {}, {}, {}, {}, {}>'.
I'm aware that Nuxt3 is not currently among the existing examples, and non of the existing ones show Typescript compatibility so I'll probably pause my experiment here for now.
Hopefully this provides enough documentation about the problem for yourselves to replicate the issue.
The text was updated successfully, but these errors were encountered:
I've gone ahead and implemented a quick work around for myself that fixes the Typescript problem, still can't get Nuxt3 working as it complains about something else (I think it's vite related because the error mentions os.networkinterfaces so something to do with bundling maybe).
When attempting to integrate the 301.js example from the Helia 101 example repo with a Nuxt3 project I ran into problems using Helia in a TypeScript context.
Lines 50 & 51 in the return statement of
createHelia
both datastore & blockstore are throwing similar but different errors.creatHelia(init?: HeliaInit | undefined)
is expecting the "Datastore" & "BlockStore" elements of the HeliaInit interface to have matching interfaces to the ones imported frominterface-datastore
&interface-blockstore
However in the 301 example the two value assigned to those elements are imported from
datastore-core
&blockstore-core
asMemoryDatastore
&MemoryBlockstore
respectively.Datastore error:
Blockstore error:
I'm aware that Nuxt3 is not currently among the existing examples, and non of the existing ones show Typescript compatibility so I'll probably pause my experiment here for now.
Hopefully this provides enough documentation about the problem for yourselves to replicate the issue.
The text was updated successfully, but these errors were encountered: