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

Unable to open an existing skill: Workspace is not a valid skill project #301

Open
techandsoftware opened this issue Feb 16, 2025 · 7 comments
Labels
bug Something isn't working

Comments

@techandsoftware
Copy link

Describe the bug

I'm editing an existing skill which I haven't touched for about 2 years. It doesn't open in VS Code. The error is "workspace is not a valid project".

Using ASK to create a new skilll, download and openining that results in the same error.

To Reproduce

  1. In ASK, click 'open local skill'
  2. Open the workspace

Expected: the skill should be visible in the SKILLS panel, but it's empty

  1. Run -> start debugging

Observed: Error popups up "workspace is not a valid skill project"

Extension Logs

[info - 2025-02-16 18:26:58.860Z] skill package schema has been updated.
[info - 2025-02-16 18:26:58.861Z] SkillPackageWatcher is disposed
[verbose - 2025-02-16 18:26:58.861Z] Calling method: getSkillMetadataSrc
[verbose - 2025-02-16 18:26:58.861Z] Calling method: getAskResourceConfig
[info - 2025-02-16 18:26:58.862Z] SkillPackageWatcher is started
[debug - 2025-02-16 18:27:07.926Z] Calling method: g.getChildren
[verbose - 2025-02-16 18:27:07.926Z] Calling method: getSkillFolderInWs
[verbose - 2025-02-16 18:27:07.926Z] Calling method: doesWorkSpaceExist
[verbose - 2025-02-16 18:27:07.926Z] Calling method: getSkillDetailsFromWorkspace
[verbose - 2025-02-16 18:27:07.926Z] Calling method: getSkillFolderInWs
[verbose - 2025-02-16 18:27:07.926Z] Calling method: doesWorkSpaceExist
[verbose - 2025-02-16 18:27:07.926Z] Calling method: getAskResourceConfig
[error - 2025-02-16 18:27:07.926Z] Workspace is not a valid skill project.

[debug - 2025-02-16 18:27:07.929Z] Calling method: d.getChildren
[debug - 2025-02-16 18:27:07.955Z] Calling method: d.getChildren
[verbose - 2025-02-16 18:27:07.955Z] Calling method: d.addRootResources
[debug - 2025-02-16 18:27:07.955Z] Calling method: d.getTreeItem
[debug - 2025-02-16 18:27:07.955Z] Calling method: d.getTreeItem
[verbose - 2025-02-16 18:27:08.371Z] Calling method: d.addRootResources
[debug - 2025-02-16 18:27:08.380Z] Calling method: d.getTreeItem
[debug - 2025-02-16 18:27:08.383Z] Calling method: d.getTreeItem
[debug - 2025-02-16 18:27:08.383Z] Calling method: d.getTreeItem
[debug - 2025-02-16 18:29:39.142Z] Calling method: ask.debugAdapterPath, args: [{"type":"pwa-node","name":"Debug Alexa Skill (Node.js)","request":"launch","trace":{"stdio":false,"logFile":null},"outputCapture":"console","timeout":10000,"timeouts":{},"showAsyncStacks":true,"skipFiles":["<node_internals>/"],"smartStep":true,"sourceMaps":true,"sourceMapRenames":true,"pauseForSourceMap":false,"resolveSourceMapLocations":["/home/rob/repo/londontraintimes/LondonTrainTimes//.(m|c|)js","!/node_modules/"],"rootPath":"/home/rob/repo/londontraintimes/LondonTrainTimes","outFiles":["/home/rob/repo/londontraintimes/LondonTrainTimes/**/.(m|c|)js","!/node_modules/"],"sourceMapPathOverrides":{"webpack:///./~/":"/home/rob/repo/londontraintimes/LondonTrainTimes/node_modules/","webpack:////":"/","webpack://@?:/?:/":"/home/rob/repo/londontraintimes/LondonTrainTimes/","webpack://?:/":"/home/rob/repo/londontraintimes/LondonTrainTimes/","webpack:///([a-z]):/(.+)":"$1:/$2","meteor://💻app/":"/home/rob/repo/londontraintimes/LondonTrainTimes/","turbopack://[project]/":"/home/rob/repo/londontraintimes/LondonTrainTimes/*"},"enableContentValidation":true,"cascadeTerminateToConfigurations":[],"enableDWARF":true,"__workspaceFolder":"/home/rob/repo/londontraintimes/LondonTrainTimes","__breakOnConditionalError":false,"cwd":"/home/rob/repo/londontraintimes/LondonTrainTimes","env":{},"envFile":null,"localRoot":null,"remoteRoot":null,"autoAttachChildProcesses":true,"runtimeSourcemapPausePatterns":[],"program":"${command:ask.debugAdapterPath}","stopOnEntry":false,"console":"internalConsole","restart":false,"args":["--accessToken","${command:ask.accessToken}","--skillId","${command:ask.skillIdFromWorkspace}","--handlerName","handler","--skillEntryFile","/home/rob/repo/londontraintimes/LondonTrainTimes/lambda/index.js","--region","EU"],"runtimeExecutable":"node","runtimeVersion":"default","runtimeArgs":[],"profileStartup":false,"attachSimplePort":null,"experimentalNetworking":"auto","killBehavior":"forceful","__configurationTarget":6,"__workspaceCachePath":"/home/rob/.config/Code/User/workspaceStorage/b15c4c333c5115a49030b17249caad58/ms-vscode.js-debug"}]
[verbose - 2025-02-16 18:29:39.612Z] Calling method: checkProfileSkillAccess
[verbose - 2025-02-16 18:29:39.612Z] Calling method: getSkillProfile
[verbose - 2025-02-16 18:29:39.612Z] Calling method: getSkillFolderInWs
[verbose - 2025-02-16 18:29:39.612Z] Calling method: doesWorkSpaceExist
[verbose - 2025-02-16 18:29:39.612Z] Calling method: getAskResourceConfig
[error - 2025-02-16 18:29:39.612Z] Workspace is not a valid skill project.

Expected behavior

The skill should open

Screenshots

Desktop (please complete the following information):

OS: Linux x64 6.6.56-05934-gf790fe104dba
Visual Studio Code Version: 1.97.2
Alexa Skills Toolkit Version: 2.16.0
Git Version: git version 2.39.5

Additional context

The skill is nodejs. I'm opening the workspace with the folder containing ask-resources.json

I've also tried creating a new nodejs skill with ASK, then opening that, and that fails with the same error.

@techandsoftware techandsoftware added the bug Something isn't working label Feb 16, 2025
@NAVOO-davidemarchesan
Copy link

NAVOO-davidemarchesan commented Feb 17, 2025

Hi,

I can confirm the issue on my end as well.
After some investigation, I was able to pinpoint where the error occurs.

The error is triggered at src\utils\skillHelper.ts:33, function getAskResourceConfig. Problem is that folderPath is undefined.
folderPath comes from src\utils\skillHelper.ts:191, function getSkillProfile, line getSkillFolderInWs(context)!.fsPath.
Variable getSkillFolderInWs(context)! is a valid vscode.Uri but fsPath is undefined.

For some reason, since last week, path is used instead of fsPath.
Tried to replace fsPath with path but started a chain of errors (built the extension from the source code and temporarily replace the code in %USERPROFILE%\.vscode\extensions).

Other information

  • Tried to downgrade Alexa Skills Toolkit to version 2.15.0 and 2.14.0, same error
  • I know that February 10th everything was working (was testing skill locally)
  • Tried to downgrade VS Code to version 1.97.1, same error
  • Tried to "Download and edit skill" a fresh skill, same error
  • Path to project has no special chars or spaces

Desktop (please complete the following information):

OS: Microsoft Windows 11 Home (10.0.26100 build 26100)
Visual Studio Code Version: 1.97.2
Alexa Skills Toolkit Version: 2.16.0
Git Version: 2.42.0.windows.2

@ItaloSa
Copy link

ItaloSa commented Feb 18, 2025

Same here!

@hypermoose
Copy link

Same here was working this weekend. No changes on my part

@ItaloSa
Copy link

ItaloSa commented Feb 22, 2025

I'm using ask cli to run my Skill locally as an alternative. It helps but with the Code Extension is so much easier

@daniel-flynn-github
Copy link

Likewise here

@NAVOO-davidemarchesan
Copy link

I have a found a temporarily fix to make the extension work again until the issue is officially resolved.

Disclaimer: I am not responsible for any corrupted or disrupted files. Read the steps before proceeding. And proceed at your own risk.

Steps to apply the fix:

  1. Clone this repo (branch development)
  2. Open the repo in VS Code
  3. Run npm install
  4. Replace the findSkillFoldersInWs() function in src\utils\workspaceHelper.ts (line 29) with the following code
export async function findSkillFoldersInWs(): Promise<vscode.Uri[]> {
  Logger.verbose("Calling method: findSkillFolders");
  const askResources = await vscode.workspace.findFiles("**/ask-resources.json");
  const skillFolders: vscode.Uri[] = [];
  askResources.forEach((resourceFileUri) => {
    const dirname: string = path.dirname(resourceFileUri.fsPath);
    const uri: vscode.Uri = vscode.Uri.file(dirname);
    Logger.verbose("Uri", uri.fsPath);
    skillFolders.push(uri);
  });
  return skillFolders;
}

Please note that even the Logger.verbose("Uri", uri.fsPath); is needed. Otherwise it won't work (do not ask me how and why)

  1. Run npm run package to build the extension in dist folder (will take some minutes) (ignore any error about $npm_config_out)
  2. Navigate to your VS code extensions folder (Where are extensions installed?)
  3. Backup the folder ask-toolkit.alexa-skills-kit-toolkit-2.16.0
  4. Replace the content of ...\.vscode\extensions\ask-toolkit.alexa-skills-kit-toolkit-2.16.0\dist with the content of the newly built dist folder
  5. Open VS Code and go to Extensions, disable, restart and then enable again Alexa Skills Kit (ASK) Toolkit (no need to restart VS Code)

This workaround works for me, and I hope it helps others too!

@rrakso
Copy link

rrakso commented Feb 27, 2025

Oh wow! That is a really fresh issue! :D

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

6 participants