import icon indicating copy to clipboard operation
import copied to clipboard

loads incorrect file

Open filip-769 opened this issue 2 years ago • 5 comments

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)

filip-769 avatar Jan 29 '23 18:01 filip-769

Seeing this as well on Deno 1.29.1 on macOS.

b3nten avatar Jan 31 '23 01:01 b3nten

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

ayoreis avatar Feb 01 '23 19:02 ayoreis

only works with force set to true for me

filip-769 avatar Feb 02 '23 14:02 filip-769

Weird could you share more about your setup?

ayoreis avatar Feb 03 '23 17:02 ayoreis

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";

filip-769 avatar Feb 14 '23 17:02 filip-769