loads incorrect file
Calling await importModule("./MY_FILE.ts") loads https://deno.land/x/[email protected]/MY_FILE.ts instead of local file MY_FILE.ts. Native dynamic import works fine. How can i fix this? (Deno 1.29.4 on Arch linux)
Seeing this as well on Deno 1.29.1 on macOS.
Ups that was a dumb mistake and should be fixed now. There a a few other thing I want to do before releasing so for now you can import this URL: https://rawcdn.githack.com/ayoreis/import/commit/766677582408979ccb856eb94b8bc1b36f42c0fd
only works with force set to true for me
Weird could you share more about your setup?
app.js
import { importModule } from "https://raw.githubusercontent.com/ayoreis/import/main/mod.ts";
console.log(await importModule("./export.js", { force: true }));
// { default: "hello" }
console.log(await importModule("./export.js", { force: false }));
/*
error: Uncaught (in promise) TypeError: Module not found "https://raw.githubusercontent.com/ayoreis/import/main/export.js".
return await import(moduleName)
^
at async importModule (https://raw.githubusercontent.com/ayoreis/import/main/mod.ts:182:10)
at async file:///xxx/app.js:5:13
*/
export.js
export default "hello";