-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
shebang script fails with "Unknown media type for <filename>..." for extension-less filename #1226
Comments
Adding a |
This is a bit tricky as Deno internals rely on file extension to resolve MediaType. @ry do you think that changing Other idea is to change this bit (in
to something like that:
EDIT:
Does TypeScript language service not like extension-less files? |
There was some discussion about it in #929. While it seems that the reasonable solution to handle extensionless filenames would be to assume TypeScript by default but then the question is that since deno can run JavaScript then how could we override the default to tell the interpretter that a particular file is actually in JavaScript. It quickly gets tricky when you consider anything more than the simplest case. I think that every executable script with a shebang shouldn't break when it's renamed or symlinked, at least I don't know of any other interpretter that interprets the executable script differently when renamed, and I think that it's reasonable to assume that no one will want to install command-line tools with extensions in their name, so this seems quite important in the long run. |
Yeah, I specifically mentioned that it wouldn't work in the PR. I don't think we should have Rust lie about the file extension. We are in the processes of splitting the compiler into a seperate isolate, and once that it done, I think the best thing to do is have the compiler tell TypeScript that files that have the media type of TypeScript but don't end in |
This issue no longer occurs on v0.2.11. CC @ry |
I tried setting up a deno script with a shebang but it fails with the following error:
Let me know if I'm missing something.
Here's more info for context:
The text was updated successfully, but these errors were encountered: