alexa / ask-toolkit-for-vscode

ASK Toolkit is an extension for Visual Studio Code (VSC) that that makes it easier for developers to develop and deploy Alexa Skills.
https://developer.amazon.com/en-US/docs/alexa/ask-toolkit/get-started-with-the-ask-toolkit-for-visual-studio-code.html
Apache License 2.0
109 stars 53 forks source link

Local debugging fails because of accessToken #186

Closed MichaelBriggsFluidra closed 2 years ago

MichaelBriggsFluidra commented 2 years ago

Describe the bug

I am trying to set up local debugging.

I followed these instructions up to the point where I have the launch.json file shown in the screenshots below.

When I click Run>Start Debugging, it throws this error an error saying the access token is not recognized as an internal or external command. I think this has something to do with the pipe character | just after 'Atza'. See screenshots for the full error.29.png)

To Reproduce

Steps to reproduce the behavior:

  1. Create a new skill with Alexa Skills Toolkit
  2. Follow the instructions here to set up local debugging
  3. Open the Run menu and then choose Start Debugging.
  4. The error occurs

Screenshots

image image

Desktop:

doiron commented 2 years ago

Just covering the basics here, are you sure you are logged in on the dev console?

https://developer.amazon.com/en-US/docs/alexa/ask-toolkit/get-started-with-the-ask-toolkit-for-visual-studio-code.html#login

follow the steps under Sign in to your Amazon developer account from VS Code.

doiron commented 2 years ago

hmm looking at the command it's trying to run it seems the access token is setup with a pipe char | and the command prompt appears to treat the remainder of the command as a new command... and hence the error that the command doesn't exist..

doiron commented 2 years ago

could you try updating the configuration to encapsulate the accesstoken param with single or double quotes?

ie.

"args" : [
   "--accessToken",
   "'#{command:ask.accessToken}'",
    ...

]
MichaelBriggsFluidra commented 2 years ago

Yep I am logged in on the dev console.

I tried encapsulating the accesstoken with double/single quotes but I'm still getting the same error.

I think you are right about the pipe char, do you know if every accesstoken contains one? If so then the issue may be with the way my vs code debugger handles it. Otherwise could it be possible to generate an accesstoken that doesn't contain a pipe char?

doiron commented 2 years ago

ok maybe try replacing pipe char with ^| somehow ? I'll try it out later but let me know if how that worked out! if so, that could potentially be done in the code as a fix eventually

MichaelBriggsFluidra commented 2 years ago

That worked! I copied the accesstoken that was printed in the error message and replaced | with ^| and the debugging session successfully started.

I am having another issue now though, the skill simulator isn't running off local files. Any changes I make aren't seen until I deploy the skill with git commit and git push , any breakpoints I set don't pause the code execution and skill inputs and outputs don't appear in the debug console.

tydonelson commented 2 years ago

Hey @MichaelBriggsFluidra , I'm trying to narrow down what the root cause of the issue here is, I was wondering if you could try a couple things in your configuration? So far, I've not been able to produce this exact behavior, even using the same VSC version you listed above.

image

image

tydonelson commented 2 years ago

I can also check on the skill simulator issue, but I'll have to get back to you on that.

MichaelBriggsFluidra commented 2 years ago

Hi @tydonelson

tydonelson commented 2 years ago

Thanks for checking on that, @MichaelBriggsFluidra ! Using "console": "integratedTerminal" is the best recommendation I have for now, we're working on getting some documentation updated around that exception for any Windows users running into the problem you're seeing. You should only have to add that line the first time you establish the launch.json skill debug configuration for a skill, so I hope it's not too painful of a workaround for now.

We are giving some thought to how to better resolve this in the future, but want to ensure that any change we make is passive and works with the many different O/S and shells that VSCode is compatible with.

github-actions[bot] commented 2 years ago

This issue is stale since it has been open for 60 days with no activity. Please respond or this issue will be closed soon.

github-actions[bot] commented 2 years ago

This stale issue has been closed now. Please reopen the issue if you are still having problems with the toolkit.