Skip to content
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

TS8013: Non-null assertions can only be used in TypeScript files. #3121

Closed
pmiguelmartins opened this issue May 4, 2023 · 8 comments
Closed
Labels
bug Something isn't working

Comments

@pmiguelmartins
Copy link

pmiguelmartins commented May 4, 2023

Width version : vue-tsc 1.6.4

this code give the error :

<template
v-for="col in slotFilters"
:key="col"
#[filter-cell-${col}]="{ column }"

error TS8013: Non-null assertions can only be used in TypeScript files.

#[filter-cell-${col}]="{ column }"

Width version : vue-tsc 1.6.3

Works just fine

Any way to solve this

Thanks

Pedro Martins

@MarceloLuis1997
Copy link

Same problem here after VSCode updated to v1.78.0

@genelee96
Copy link

I tried multiple different methods to try and fix it, but ultimately came up short. Tried to compute the slot name, tried to do a null check for {column} and conditionally render it, etc. Ultimately this just stared happening with thew new VSCode update, since I havn't changed my code since before the update and it worked fine then.

@omerbackflip
Copy link

well, i have the same problem.... any solution ?

@MarceloLuis1997
Copy link

microsoft/vscode#181630

@qbuache
Copy link

qbuache commented May 11, 2023

I have that issue since I upgraded vue from 3.2.45 to 3.3.1. No error message prior to that with VSCode 1.78.1

@softy2k
Copy link

softy2k commented May 11, 2023

Same error with VSCode 1.78.1, Volar 1.6.4 , TypeScript Vue Plugin (Volar) 1.6.4

@NetMango
Copy link

Same problem with Quasar which is based on Vue3:

<template v-for="(htmlColumn, key) in htmlColumns" :key="key" v-slot:[computedBodyCellName(key)]="scope"> <q-td :scope="scope" auto-width>

Only VSCode shows this error, but code works perfectly.

Version: 1.78.1
Commit: 6a995c4f4cc2ced6e3237749973982e751cb0bf9
Date: 2023-05-04T09:46:23.602Z
Electron: 22.5.1
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Linux x64 5.15.0-71-generic
Sandboxed: Yes

@rtroost
Copy link

rtroost commented May 12, 2023

I don't think this is a Volar issue because our prod builds fail as well because of this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants