Coder Social home page Coder Social logo

Comments (5)

dsherret avatar dsherret commented on August 26, 2024

Can you provide a reproduction? Is this a duplicate of #18327 ?

from deno.

keelii avatar keelii commented on August 26, 2024

Can you provide a reproduction? Is this a duplicate of #18327 ?

@dsherret I seems like is a same issue.

➜  deno_test tree      
.
├── log.ts
└── test.ts
➜  deno_test cat log.ts      
console.log(1)
➜  deno_test cat test.ts 
const log = './log.ts';
await import(log);
➜  deno_test deno run ./test.ts  
1
➜  deno_test deno compile test.ts
Check file:///Users/XXX/deno_test/test.ts
Compile file:///Users/XXX/deno_test/test.ts to test
Archive:  /var/folders/56/18ks5nln0hd8h104twhl9tz80000gn/T/.tmpsDgz1q/denort.zip
  inflating: denort                  
➜  deno_test ./test 
error: Uncaught (in promise) TypeError: Module not found: file:///Users/XXX/deno_test/log.ts
await import(log);
^
    at async file:///Users/XXX/deno_test/test.ts:2:1
➜  deno_test 

Why it is ok on deno run, but not for deno compile?

from deno.

Mutefish0 avatar Mutefish0 commented on August 26, 2024

try change

const log = './log.ts';
await import(log);

to:

await import('./log.ts');

docs: https://docs.deno.com/runtime/manual/tools/compiler/#dynamic-imports

from deno.

keelii avatar keelii commented on August 26, 2024

try change

const log = './log.ts';
await import(log);

to:

await import('./log.ts');

docs: https://docs.deno.com/runtime/manual/tools/compiler/#dynamic-imports

@Mutefish0 I mean log is dynamic path.

from deno.

dsherret avatar dsherret commented on August 26, 2024

Why it is ok on deno run, but not for deno compile?

It's a techincal challenge that hasn't been implemented.

Duplicates #18327

from deno.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.