Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run file without extension (.ts or .js) #5368

Closed
davidnguyen11 opened this issue May 14, 2020 · 5 comments
Closed

Cannot run file without extension (.ts or .js) #5368

davidnguyen11 opened this issue May 14, 2020 · 5 comments

Comments

@davidnguyen11
Copy link

davidnguyen11 commented May 14, 2020

So I have structure of app like this

index.ts
package.json

package.json

worked

{
  "scripts": {
    "test": "deno run index.ts"
  }
}

not working

{
  "scripts": {
    "test": "deno run index.ts"
  }
}

I am not sure that whether or not deno will support execute script without extension name in the future.

@tkgalk
Copy link
Contributor

tkgalk commented May 14, 2020

  1. package.json is part of Node.js stack, not Deno.
  2. Deno doesn't support imports without the extension name.
import { x } from "./test.ts"; // works
import { x } from "./test"; // won't

@nayeemrmn
Copy link
Collaborator

I am not sure that whether or not deno will support execute script without extension name in the future.

It won't, or it would already. Duplicate of #2506.

@kt3k
Copy link
Member

kt3k commented May 14, 2020

(off-topic: I think this should be in the list of FAQ)

@davidnguyen11
Copy link
Author

should it be somewhere in documentation? I think many JS developers have the same concern.

@Soremwar
Copy link
Contributor

Soremwar commented May 15, 2020

@davidnguyen179 Technically is more directed towards Node users, JS users are aware of this

A common asked question section would be cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants