Skip to content

Error: failed to get plugin instance:instantiating extism module: source module must be compiled before instantiation #97

Open
@johanjanssens

Description

@johanjanssens

Using: github.com/extism/go-sdk v1.7.0

When using a compiled plugin with the compilation cache I'm getting a failed to get plugin instance:instantiating extism module: source module must be compiled before instantiation

ctx := context.Background()
cache := wazero.NewCompilationCache()
defer cache.Close(ctx)

manifest := extism.Manifest{
    Wasm: []extism.Wasm{
        extism.WasmFile{Path: "./plugin/plugin.wasm"},
    },
}

config := extism.PluginConfig{
    EnableWasi:   true,
    ModuleConfig: wazero.NewModuleConfig(),
    RuntimeConfig: wazero.NewRuntimeConfig().WithCompilationCache(cache),
}

plugin, err := extism.NewCompiledPlugin(ctx, manifest, config, []extism.HostFunction{})

Disabling RuntimeConfig: wazero.NewRuntimeConfig().WithCompilationCache(cache), makes it work

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions