We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I tried to use type assertion with angle brackets in my Typescript files, and Parcel compiled that to invalid code, throwing errors at runtime.
There’s no configuration
yarn parcel build fail.ts pass.ts
Parcel should strip type assertion without breaking the code:
(async()=>{const o=await new Promise((o=>setTimeout(o,10)));console.log(o)})();
Parcel produces the following code:
(async()=>{await new Promise((e=>setTimeout(e,10))),console.log(a)})();
No idea
I thought that <Type>x is clearer than x as Type, but I can still use the latter until the bug is fixed.
<Type>x
x as Type
// fail.ts (async() => { const a = await new Promise(resolve => setTimeout(resolve, 10)); console.log(<number>a); })(); // pass.ts (async() => { const a = await new Promise(resolve => setTimeout(resolve, 10)); console.log(a); })();
The text was updated successfully, but these errors were encountered:
This was already fixed (probably with #7114). It works correctly with the nightly (yarn add parcel@nightly -E)
yarn add parcel@nightly -E
Sorry, something went wrong.
No branches or pull requests
🐛 bug report
I tried to use type assertion with angle brackets in my Typescript files, and Parcel compiled that to invalid code, throwing errors at runtime.
🎛 Configuration (.babelrc, package.json, cli command)
There’s no configuration
🤔 Expected Behavior
Parcel should strip type assertion without breaking the code:
😯 Current Behavior
Parcel produces the following code:
💁 Possible Solution
No idea
🔦 Context
I thought that
<Type>x
is clearer thanx as Type
, but I can still use the latter until the bug is fixed.💻 Code Sample
🌍 Your Environment
The text was updated successfully, but these errors were encountered: