Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
johanjanssens opened this issue Feb 20, 2025 · 0 comments

Comments

@johanjanssens
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant