diff options
Diffstat (limited to 'runtime/examples')
-rw-r--r-- | runtime/examples/hello_runtime.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/runtime/examples/hello_runtime.rs b/runtime/examples/hello_runtime.rs index b8b152467..ac872c192 100644 --- a/runtime/examples/hello_runtime.rs +++ b/runtime/examples/hello_runtime.rs @@ -1,5 +1,6 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. +use deno_core::anyhow::Context; use deno_core::error::AnyError; use deno_core::FsModuleLoader; use deno_runtime::deno_broadcast_channel::InMemoryBroadcastChannel; @@ -69,7 +70,10 @@ async fn main() -> Result<(), AnyError> { let js_path = Path::new(env!("CARGO_MANIFEST_DIR")).join("examples/hello_runtime.js"); - let main_module = deno_core::resolve_path(&js_path.to_string_lossy())?; + let main_module = deno_core::resolve_path( + &js_path.to_string_lossy(), + &std::env::current_dir().context("Unable to get CWD")?, + )?; let permissions = PermissionsContainer::allow_all(); let mut worker = MainWorker::bootstrap_from_options( |