Reload of local Lambda code fails with non .mjs index
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 807
- Avg merge
- 10h 12m
- Merged PRs (30d)
- 7
Description
## Problem
After successfully loading a local version of my Lambda code, if I restart VSCode, an error occurs and the code won't reload. I get a warning that the file index.mjs doesn't exist.
## Steps to reproduce the issue
1. Create and upload a node function that is structured with an index.js file (not index.mjs).
2. Go to the AWS toolkit->Lambda section and expand the function (which succeeds with warning)
3. Restart VSCode and repeat step 2
4. Error shows, saying "Failed to load resources"
The following log information is reported:
` 2025-07-13 09:23:01.295 [error] Error:
at ue (c:\Users\eric\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-3.69.0-gd1959b9\dist\src\extensionNode.js:2591:2068)
at c:\Users\eric\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-3.69.0-gd1959b9\dist\src\extensionNode.js:2591:7397
at ce (c:\Users\eric\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-3.69.0-gd1959b9\dist\src\extensionNode.js:2591:6073)
at ee (c:\Users\eric\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-3.69.0-gd1959b9\dist\src\extensionNode.js:2591:5957)
at Object.getChildNodes (c:\Users\eric\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-3.69.0-gd1959b9\dist\src\extensionNode.js:2597:23066)
at R (c:\Users\eric\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-3.69.0-gd1959b9\dist\src\extensionNode.js:2741:17482)
at R.getChildren (c:\Users\eric\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-3.69.0-gd1959b9\dist\src\extensionNode.js:2597:23004)
at R.getChildren (c:\Users\eric\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-3.69.0-gd1959b9\dist\src\extensionNode.js:2499:12102)
at N4.Y (file:///c:/Users/eric/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:164:89098)
at N4.getChildren (file:///c:/Users/eric/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:164:85612)
at $q.$getChildren (file:///c:/Users/eric/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:164:82282)
`
## Expected behavior
The code should reload. Note that this works as expected for functions that do have an index.mjs file, so I suspect it relates to the file extension.
## System details
- OS: Windows
- Visual Studio Code version:
- AWS Toolkit version: 3.69 prelease
- Amazon Q version:
Contributor guide
Research direction
Start by reproducing the reload from the AWS Toolkit Lambda section with a function whose entry file is index.js, then compare it with the working index.mjs case. Inspect the extensionNode.js stack trace and the local Lambda resource-loading path; done means the function reloads after restarting VS Code without reporting that index.mjs is missing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, javascript, typescript, vscode
- Domain
- backend, cloud, devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100