-
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
Deno panic using JSX #21927
Comments
If I remove the first line <h1>Hello World</h1> as expected. |
In Deno |
|
@dsherret could you please take a look? |
For SWC, a user-friendly error is preferable to a panic. |
I think there is a bit of confusion as to what the That said Deno should not panic on this though. |
In the context of Deno I don't think it should error at all right? Given it's a runtime, not a compiler. |
Deno is kinda both. To support TypeScript the types need to be stripped somewhere since V8 only works with normal JavaScript. Same is true for JSX, so there are some light transpilation passes in Deno to make this work. |
Yeah that's true. I think in this case though, an invalid pragma is still valid javascript/typescript? I did a quick test and it panics even if you have just the pragma without any JSX. |
**Description:** Currently a jsx pragma with an invalid js identifier (eg, with dashes: `@jsx bad-pragma` causes a panic. This PR prevents a panic and will ignore an invalid pragma in a comment. (There may be an argument for showing an error or warning instead, but given a jsx pragma is still valid ES I'm not sure whether that makes sense?) [Original (Deno) issue here](denoland/deno#21927)
Code to reproduce:
execute:
deno run main-deno.tsx
deno.json:
{ "compilerOptions": {} }
The text was updated successfully, but these errors were encountered: