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

Cannot debug locally using the toolkit #168

Open
isaacporat opened this issue Feb 25, 2022 · 4 comments
Open

Cannot debug locally using the toolkit #168

isaacporat opened this issue Feb 25, 2022 · 4 comments
Labels
bug Something isn't working investigating

Comments

@isaacporat
Copy link

OS: Windows_NT x64 10.0.19043
Visual Studio Code Version: 1.64.2
Alexa Skills Toolkit Version: 2.10.1
Git Version: git version 2.34.1.windows.1
Python version 3.8.7

I am trying to follow a workflow where I can debug locally; changing my Python code locally, testing with the simulator, repeating the process as required and only then deploy.

I am using the 'Alexa hosted' option and hence, as instructed deploy using git.

I created a new project using the 'cli new' command, I am using the default 'Hello World' template. It works well using the 'cli dialog' simulator on the code in the cloud of course.

The older approach localhost / ngrok / local_debugger.py (from the cookbook) works well for debugging locally but it is more cumbersome; running ngrok and changing the end point parameters in the console, hence trying the toolkit.

I installed the toolkit in VSCode as per instructions including setting the launcher.
I installed ask-sdk-local-debug in the Python virtual folder.
When I start the debugger it is indicated correctly on the status bar.

When I test using the toolkit simulator, regardless of whether I started the debugger or not the skill runs the code in the cloud that I deployed before not local code.
There is no indication that the debugger runs on the terminal or the debug console.
Note that I don't even debug as such; I just modified a message in the lambda_function.py file so that I can distinguish between the local and cloud versions of the code when running the simulator.

What am I doing wrong?

Thanks
Isaac

@github-actions
Copy link

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

@isaacporat
Copy link
Author

Hello

I managed to get local debugging to work as follows:

The project I had the problem with was created using the cli with the 'ask new' command.
I worked on it for a while but it is essentially 'Hello World' with minor modifications.
I opened the project in VSCode using the context menu in FileExplorer in Windows 10.
The debugger started with no error indication but using the simulator the remote code was run instead of the local one (as if the debugger was not running at all).

I thought this might be to do with the metadata in ask-resources.json
In the Toolkit Management view I tried to open the project first and then tried the download option. I was informed in both cases that the metadata was updated but still local debugging did not work.
I then created a new project from scratch in the Management view, copied my code and other relevant files from the initial project and the local debug started to work as expected.
The cli simulator 'ask dialog' works well too.
Perhaps I should not have assumed that a cli created project should work with the Toolkit
but at least, when the debugger starts and regardless of the reasons why the local code is not run, a clear error should be given to the developer.

Thanks
Isaac

@github-actions
Copy link

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

@github-actions
Copy link

github-actions bot commented Apr 3, 2022

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

@github-actions github-actions bot closed this as completed Apr 3, 2022
@Shreyas-vgr Shreyas-vgr added bug Something isn't working and removed closing soon if no response labels Apr 28, 2022
@Shreyas-vgr Shreyas-vgr reopened this Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working investigating
Projects
None yet
Development

No branches or pull requests

2 participants