Skip to content

LinkError: WebAssembly.instantiate(): Import #16 "wasi_snapshot_preview1" "fd_prestat_get": function import requires a callable #5037

@SksOp

Description

@SksOp

I am implementing a simple wrapper of cel-go that can run in browser.
First I was using go, which worked just fine in terms of logic. However as soon as I moved from go to tinygo in order to optimise the file size of wasm.
I ran into this issue that I do not understand

 LinkError: WebAssembly.instantiate(): Import #16 "wasi_snapshot_preview1" "fd_prestat_get": function import requires a callable

An example reproducible function for v0.39.0

import (
	celgo "github.com/google/cel-go/cel"
)

func CanRun(expression string) bool {
	// Create a basic CEL environment for syntax checking
	env, err := celgo.NewEnv()
	if err != nil {
		return false
	}

	// Try to parse and check the expression
	_, issues := env.Parse(expression)
	if issues != nil && issues.Err() != nil {
		return false // Invalid syntax, but not an internal error
	}

	return true
}

I would like to know is this a problem with tinygo, a limitation or is there something missing in worker_exec.js . Is there any workaround?

Metadata

Metadata

Assignees

No one assigned

    Labels

    wasmWebAssembly

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions