Skip to content

[bug] _tauri_plugin_functions not defined #1

@AyuBloom

Description

@AyuBloom

I'm not sure if i missed any steps in README.md, but i would get the following error when the app runs:

thread '<unnamed>' panicked at /Users/rdm/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tauri-plugin-deno-0.2.0/src/deno_lib.rs:98:10:
Error initializing main.js: Js(JsError { name: Some("ReferenceError"), message: Some("_tauri_plugin_functions is not defined"), stack: Some("ReferenceError: _tauri_plugin_functions is not defined\n    at file:///path/to/src-tauri/src-deno/main.js:5:25"), cause: None, exception_message: "Uncaught (in promise) ReferenceError: _tauri_plugin_functions is not defined", frames: [JsStackFrame { type_name: None, function_name: None, method_name: None, file_name: Some("file:///path/to/src-tauri/src-deno/main.js"), line_number: Some(5), column_number: Some(25), eval_origin: None, is_top_level: Some(true), is_eval: false, is_native: false, is_constructor: false, is_async: false, is_promise_all: false, promise_index: None }], source_line: None, source_line_frame_index: Some(0), aggregated: None })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

And when i call the function in the frontend, it gives me this error:

thread 'tokio-runtime-worker' panicked at /Users/rdm/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tauri-plugin-deno-0.2.0/src/commands.rs:51:5:
called `Result::unwrap()` on an `Err` value: SendError { .. }

My src-deno/main.js:

function greetJs(input) {
  return input + " from main.js";
}

_tauri_plugin_functions = [greetJs.name]; // This will make the function "greetJs" callable from UI

Appreciate the help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions