-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Errors compiling runtime agnostic JavaScript to TypeScript #59439
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
Comments
Looks like you're trying to use all of |
Why won't this work? If it doesn't, it should. |
He wrote why it won't work, and the reason makes sense. |
Doesn't make sense to me. If we can branch in JavaScript with basic |
For example one of your included types says the global type This issue does not seem to be describe an actual bug in TypeScript and seems to be a question. Please note that this repository is for bug reports and feature requests, it's not a general purpose help forum (see this). You can try the TypeScript Discord or StackExchange for this (or any other). Personally I would advice to first learn the basics of TypeScript using simpler projects, instead of forcefully trying to push your idea without understanding what you're doing. |
Then I guess this is a bug and a feature request. If the code works as intended in JavaScript the code should work as intended in TypeScript, if in fact TypeScript is a "superset" of JavaScript.
I don't do simple projects. I test, experiment, hack multiple JavaScript engines and runtimes. The requirement must be challenging for me to even consider diving in to. When possible, as in this case, I use the same code for
It's very simple. My goal is to create a My only interest here is to visually observe what TypeScript programming language outputs for the JavaScript code I have written that works as intended. If TypeScript does not have the capability to branch in basic Does |
But it's not. You're neither demonstrating a bug with TypeScript, nor are you suggesting a specific feature (which has it's own issue template). You're facing an issue using TypeScript and don't understand the error message you get and ask here for help.
Relevant link: Is TypeScript really a superset of JavaScript?
I too enjoy the challenge of ramming my head through the door. I don't waste time learning to use door handles! Learning the basics of whatever tool you choose to use is an appropriate first step to face whatever challenge you choose. By skipping this crucial step you end up in situations like this: Not understanding the error you get, trying to report it as a bug when it's clearly not.
As I mentioned earlier: TypeScript does have this capability, if the types are written accordingly. The type libraries you included are not written like that (intentionally). So you can either fall back to
The TypeScript compiler Anyway, I'm out. This issue will lead to nowhere. |
That's all you had to say in the first place. |
🔎 Search Terms
runtime agnostic
🕗 Version & Regression Information
npm:@typescript-deploys/pr-build@5.6.0-pr-58573-19
⏯ Playground Link
No response
💻 Code
🙁 Actual behavior
Rename
nm_host.js
tonm_host.ts
.A lot of errors. Summarized at the bottom of the attached file
typescript-errors.txt
🙂 Expected behavior
What I'm really trying to do here is convert valid, working runtime agnostic JavaScript that achieves the expected result using the same code with
node
,deno
, andbun
, to TypeScript, and create a.ts
file from JavaScript source.Additional information about the issue
Using
npm:@typescript-deploys/pr-build@5.6.0-pr-58573-19
for resizableArrayBuffer
support.The text was updated successfully, but these errors were encountered: