microsoft / microsoft/TypeScript
Incorrect ts(7053) error when updating json file
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.3k
- Merge medio
- 2g 4h
- PR unite (30g)
- 132
Descrizione
Bug Report
I have strings stored in a json file.
I did set "resolveJsonModule": true, in the tsconfig.
I import the strings as follows:
import * as strings from '../languages/en.json';
Works perfectly.
When I add a string in the json file and I then try to use that new string, intellisense always gives me the ts(7053) error.
Everything builds and works but the code remains underlined as a problem.
The only workaround I found to get rid of the incorrect report is to close VSCode and reopen it.
Broken in TypeScript v4.1.5
Works in TypeScript v4.0.5
VS Code
Version: 1.53.2
Commit: 622cb03f7e070a9670c94bae1a45d78d7181fbd4
Date: 2021-02-11T11:45:54.515Z
Electron: 11.2.1
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Darwin x64 20.3.0
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Riproduci il problema con resolveJsonModule abilitato, un file JSON importato e una stringa appena aggiunta, confrontando TypeScript 4.1.5 con 4.0.5. Inizia esaminando il comportamento del language service alla base della diagnostica ts(7053) e verifica che la diagnostica scompaia senza riavviare VS Code quando il JSON cambia.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- compilers, developer-experience
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100