extism / js-pdk

Write Extism plugins in JavaScript & TypeScript
42 stars 16 forks source link

Error: module[extism:host/env] not instantiated #49

Closed superchris closed 4 months ago

superchris commented 4 months ago

In attempting to follow along with the basic instructions for building the plugin I get the following error when building, altho a wasm file is produced:

warning: unknown name subsection with id 9 at 4579967

And when I run:

extism call plugin.wasm greet --input="foo" --wasi

I get the above error:

Error: module[extism:host/env] not instantiated

Any ideas what would cause this. I literally just copied and pasted the plugin.js and plugin.d.ts` files from the README.

bhelx commented 4 months ago

We changed the namespaces when we upgraded to 1.0. Is your extism cli up to date? What version of extism-js did you use to compile the plug-in? Btw you can ignore the warning it is not related

superchris commented 4 months ago

Yup, i had an earlier version of the CLI on my path that was causing the problem. Also important to pass --wasi for things to work, that was the next issue I hit :)