DEV Community

[Comment from a deleted post]
Collapse
 
ryougi1 profile image
James Long Gu

Hi Josh, thanks for the interesting read!

Inside index.ts, I'm getting the error 'Type "ASUtil" is not generic'. It's the same code you have, any idea why?

Collapse
 
jtenner profile image
jtenner

Yep! This AssemblyScript primer is outdated in very little ways. Instead, use ASUtil & T. The generic part used to be the exported wasm API that you expect the module to return. Now it's just a plain interface.

const wasm: ASUtil & T = instantiateBuffer<T>(buffer, imports);
Collapse
 
ryougi1 profile image
James Long Gu

Cheers Josh! Managed to import the AS loader and run some basic tests with __allocString and __getString. Works like a charm!

 
jtenner profile image
jtenner

That's great! Make sure to speak up when you have problems. Assemblyscript is a burgeoning platform and things don't always work! You can also check out docs.assemblyscript.org/ for lots of documentation.

Good luck!