tutorialkit icon indicating copy to clipboard operation
tutorialkit copied to clipboard

Extension: Silently fails in VSCode workspace when non-existing project defined

Open AriPerkkio opened this issue 1 year ago • 0 comments

Describe the bug

The VSCode extension silenty fails when VS Code workspace has a directory defined that doesn't exist. When Select tutorial command is used, an error is shown:

Command 'Select Tutorial' resulted in an error A system error occurred (ENOENT: no such file or directory, open '/Users/x/non-existing-folder/package.json')

Could we improve the error handling? Or ignore directories that don't exist, instead of crashing?

Steps to reproduce

  1. Create VS Code workspace file repro.code-workspace with content:
{
  "folders": [
    {
      "path": "./non-existing-folder"
    },
    {
      "path": "./tutorial-vite-plugin" // <-- Any existing real tutorial works, use npm create tutorial 
    }
  ]
}
  1. code repro.code-workspace
  2. Notice how extensions tree view is empty
  3. Run Select tutorial from VS Code's command palette (CMD + Shift + P) to see error message

Expected behavior

Remove the non-existing project from workspace configuration and see how extension works again.

Platform

  • TutorialKit version: 0.1.2
  • Extension: 0.1.0

AriPerkkio avatar Aug 05 '24 15:08 AriPerkkio