Skip to content

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

Open
@piaoger

Description

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;

Metadata

Assignees

No one assigned

    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