yoavbls / pretty-ts-errors

🔵 Make TypeScript errors prettier and human-readable in VSCode 🎀
https://marketplace.visualstudio.com/items?itemName=yoavbls.pretty-ts-errors
MIT License
13.29k stars 89 forks source link

Formatted Error Shows Raw HTML #52

Closed joshua-lafever closed 1 year ago

joshua-lafever commented 1 year ago

Describe the bug The error formatting is odd and is displaying what appears to be an icon that isn't properly interpolated.

This is the line that caused the error:

return (control.value > max) ? { maxDate: true } | null;

The error is being caused by accidentally typing | instead of :, but the formatting of the error is strange.

I haven't seen any other instances like this and I've been using this extension for the past week.

Expected behavior To show the styled error.

Original error The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.

Screenshots If applicable, add screenshots to help explain your problem.

image

Sheraff commented 1 year ago

I got the exact same error and came to report it as well. Here's mine:

latinReleases.sort((a, b) => a["release-group"]["first-release-date"] - b["release-group"]["first-release-date"])

No syntax error (just a type coercion that Typescript doesn't like). Here's the output:

Screen Shot 2023-04-29 at 18 00 09

I'm on v0.3.0, with vscode 1.77.3

yoavbls commented 1 year ago

It was fixed in v0.4.0, take a look 🙂