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

Bug: sam build - ValueError #7569

Open
franckpochet opened this issue Oct 15, 2024 · 7 comments
Open

Bug: sam build - ValueError #7569

franckpochet opened this issue Oct 15, 2024 · 7 comments
Labels
blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale.

Comments

@franckpochet
Copy link

Description:

Try to run hello-world SAM sample localy in VSCode

Steps to reproduce:

Create the project hello-world with SAM
Open it in VSCode
Create a launch.json
Run the code in nodejs20.x

Observed result:

[info] Error: path is on mount 'E:', start on mount 'C:' (why?)
last stack trace:
File "E:\aws\AWSSAMCLI\runtime\Lib\site-packages\samcli\commands_utils\template.py", line 267, in _resolve_relative_to
return os.path.relpath(
^^^^^^^^^^^^^^^^
File "", line 783, in relpath

Expected result:

Code run :-)

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

Windows 11 23H2
AWS CLI : 2.18.6
SAM CLI : 1.125.0

Thank you

@franckpochet franckpochet added the stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. label Oct 15, 2024
@franckpochet
Copy link
Author

Sorry forgot to indicate that I'm using VSCode 1.94.1 with AWSToolkit 3.28.0

@mndeveci
Copy link
Contributor

Thanks for reporting this issue. Can you explain how did you created launch.json file? I saw taht you mentioned a version for the AWSToolkit extension, if you are using that, it should have a shortcut to invoke your function directly (it should be visible when you open your lambda handler). Can you try with that to see if it has any issues?

@mndeveci mndeveci added blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale. and removed stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. labels Oct 16, 2024
@franckpochet
Copy link
Author

Hello,
To create the lauch.json I add a configuration in the run menu. I don't saw any shortcut to invoke directly the function, where this shortcut must be shown?
Thank you

@mndeveci
Copy link
Contributor

You should see Run Locally or Debug Locally links like this
image

See: https://aws.amazon.com/visualstudiocode/

With those shortcuts, launch.json configuration should be automatically added by the AWS extension.

@franckpochet
Copy link
Author

Hi,
No I don't have it, but perhaps is because I created the project from a command windows with "sam init" and not from VSCode?
Thank you
Regards

@mndeveci
Copy link
Contributor

But this should work even if you open your project. Can you make sure your root folder is the project's root folder? Also, can you make sure you open the lambda function handler? You should be able to see these shortcuts above.

@franckpochet
Copy link
Author

Hello,
Yes I'm sure for both and no I don't see the shortcut.
Regards
Franck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale.
Projects
None yet
Development

No branches or pull requests

2 participants