Describe the bug
after update to 1.1.15 svelte-check returns error on each svelte component
<component>.svelte:NaN:1
Error: ts__default$1.default.isTypeAssertionExpression is not a function (ts)
project builds and works ok, vscode shows no error
To Reproduce
npm upgrade && npx svelte-check
System (please complete the following information):
Additional context
"devDependencies": {
"@rollup/plugin-commonjs": "^14.0.0",
"@rollup/plugin-node-resolve": "^8.0.0",
"@rollup/plugin-typescript": "^6.1.0",
"@tsconfig/svelte": "^1.0.0",
"rollup": "^2.33.3",
"rollup-plugin-livereload": "^2.0.0",
"rollup-plugin-svelte": "^6.1.1",
"rollup-plugin-terser": "^7.0.0",
"svelte": "^3.29.7",
"svelte-check": "^1.1.15",
"svelte-preprocess": "^4.6.1",
"tslib": "^2.0.3",
"typescript": "^3.9.7"
}
Try upgrading TypeScript to the latest version. It seems like the isTypeAssertionExpression function got added only recently to TypeScript, which we are using inside svelte2tsx.
@jasonlyu123 should we maybe fall back to using a "handcrafted" version of that function? As an alternative we can also just check for the existence of this function. It will "only" prevent people from getting the <any>foo to foo as any transformation. I think I'm slightly in favor of the latter solution. Edit: I chose the latter solution for a simple fix. If you think that's crap we can switch to the handcrafted function.
Try upgrading TypeScript to the latest version. It seems like the
isTypeAssertionExpressionfunction got added only recently to TypeScript, which we are using insidesvelte2tsx.
Thanks. Problem solved :-)
Most helpful comment
Thanks. Problem solved :-)