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

failed to resolve: could not find deno_core in the list of imported crates #982

Open
piaoger opened this issue Nov 25, 2024 · 0 comments
Open

Comments

@piaoger
Copy link

piaoger commented Nov 25, 2024

I got this "failed to resolve" issue while upgrading from "deno_core: v0.245.0 + v8: v0.82.0" to "deno_core: v0.322.0 + v8: v130.0.1".
I just wonder if it's as design or I can do someting to fix this build error.

environment

In my case, I have a separated "javascript_engine" crate which wraps and re-exports deno_core and serde_v8.
In downstream some_library, I am just using javascript_engine::deno_core.

some_library ---> javascript_engine --> deno_core

code snippets in javascript_engine and some_library

  • javascript_engine/src/lib.rs
pub use deno_core;
pub use serde_v8;
  • some_library/src/builder/deno_exec_engine.rs
// use deno_core from wrapped javascript engine
use javascript_engine::{
    deno_core::{
        error::AnyError,
        op2, v8, OpDecl, Extension, FastString, JsRuntime, Op, RuntimeOptions
    },
    serde_v8
};

#[op2]
pub(crate) fn op_sum(#[serde] nums: Vec<f64>) -> std::result::Result<f64, AnyError> {
    let sum = nums.iter().fold(0.0, |a, v| a + v);
    Ok(sum)
}

error message

error[E0433]: failed to resolve: could not find `deno_core` in the list of imported crates
  --> crates/some_library/src/builder/deno_exec_engine.rs:25:1
   |
25 | #[op2]
   | ^^^^^^ could not find `deno_core` in the list of imported crates

temporary solution

As a temporary solution, I just add deno_core as dependencies and use it in some_library directly.

// deno_core
use deno_core::{
    error::AnyError,
    op2, v8, OpDecl, Extension, FastString, JsRuntime, Op, RuntimeOptions
};
use serde_v8;
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