question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Task: Typescript errors disappear after document closed

See original GitHub issue
  • VSCode Version: 1.22.1 (newest) (typescript 2.8.1)
  • OS Version: Windows 10 64bit

I expect typescript errors from all files to show until they have been fixed.

Instead, they disappear as soon as the document is closed again (e.g. by randomly clicking on the error list, which causes documents to open & close again)

Steps to Reproduce:

  1. Use this tasks.json (check if the project path fits you first)
{
    "version": "2.0.0",
    "command": "tsc",
    "isShellCommand": true,
    "args": [
        "-w",
        "-p",
        "."
    ],
    "showOutput": "silent",
    "isBackground": true,
    "problemMatcher": {
        "base": "$tsc-watch",
        // "owner": "typescript",
        //  "applyTo": "allDocuments"
    }
}
  1. Start the task
  2. Errors will show in error list (hopefully, if there are errors at all)
  3. Randomly click between errors of different files in error list. The files will open and close automatically (if they are not pinned). When a file closes, it’s errors disappear!

What I have tried:

  • $tsc-watch matcher without any other options
  • owner property “typescript” or something artificial
  • applyTo property all possibilities
  • in settings: typescript.validate.enable === false

The “best” in my trial and error endevour I have got was that the errors just persisted, even when fixed, lol 😃

My user settings (don’t have workspace settings)

{
    "terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
    "editor.wordWrap": "on",
    "explorer.confirmDelete": false,
    "editor.quickSuggestions": {
        "other": false,
        "comments": false,
        "strings": false
    },
    "editor.autoClosingBrackets": false,
    "explorer.confirmDragAndDrop": false,
    "editor.acceptSuggestionOnCommitCharacter": false,
    "window.zoomLevel": 0,
    "explorer.autoReveal": true,
    "editor.suggestOnTriggerCharacters": true,
    "editor.acceptSuggestionOnEnter": "on",
    "editor.parameterHints": true,
    "typescript.referencesCodeLens.enabled": false,
    // "typescript.validate.enable": false
}

Does this issue occur when all extensions are disabled?: Yes

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:21
  • Comments:19 (11 by maintainers)

github_iconTop GitHub Comments

7reactions
massimonewsukcommented, May 3, 2018

We recently swapped from Flow to TypeScript.

In our previous workflow with Flow, the errors would remain when we opened/closed files.

However, with Typescript, none of the errors show by default (when all files are closed). For this reason, we use VSCode’s Tasks -> Run Build Task, to run the detected tsconfig.watch. This is great because it shows all errors across the project without having to open files.

However, when we open a file then close it, the error disappears from the problems tab (same issue as described above).

We would love for there to be a configuration option to disable removing errors from problems tab until they are fixed. This would be a simple fix. An even cooler one would be for this behaviour to be automatic when using a typescript watcher.

4reactions
massimonewsukcommented, May 17, 2018

Yes but after you close a file, the errors disappear from the file browser bar and the IDE’s problems summary

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript errors not showing in VSCode editor using ...
In your VSC's Extensions panel, type "@builtin" and look for "TypeScript and JavaScript Language Features" in the "Features" section.
Read more >
Error MSB4062 The "TypeScript.Tasks ...
This issue is read only, because it has been in the Closed - Fixed state for over 90 days. It was closed for...
Read more >
TypeScript errors and how to fix them
You have to close the string literal with an ending ' : ... error TS1046: Top-level declarations in .d.ts files must start with...
Read more >
Strict mode - JavaScript - MDN Web Docs
Using "use strict" in functions with rest, default, or destructured parameters is a syntax error. function sum(a = 1, b = 2) ...
Read more >
Fixes or workarounds for recent issues in Outlook for PC
[INVESTIGATING] Outlook errors marking task complete and sending task ... [FIXED] Something is wrong with one of your data files and Outlook needs...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found