Giter Club home page Giter Club logo

Comments (6)

jpinkney-aws avatar jpinkney-aws commented on August 19, 2024

Can you try adding the following setting to your package.json "aws.samcli.enableCodeLenses": true and then re-running the launch config

from aws-toolkit-vscode.

jpinkney-aws avatar jpinkney-aws commented on August 19, 2024

As it turns out, as a last resort if we can't find the codeRoot we fall back to discovering the project root:

  1. https://github.com/aws/aws-toolkit-vscode/blob/master/packages/core/src/shared/sam/debugger/typescriptSamDebug.ts#L62
  2. https://github.com/aws/aws-toolkit-vscode/blob/master/packages/core/src/shared/sam/debugger/typescriptSamDebug.ts#L43
  3. findParentProjectFile expects globals.codeLensRegistry to be defined and globals.codeLensRegistry only gets defined when this is true in the settings: "aws.samcli.enableCodeLenses": true

The reason why it goes through that codepath is because originally codeRoot isn't defined because there isn't a CodeUri in the template: https://github.com/aws/aws-toolkit-vscode/blob/master/packages/core/src/lambda/local/debugConfiguration.ts#L134

from aws-toolkit-vscode.

sm0ke21 avatar sm0ke21 commented on August 19, 2024

Hey there, first of all thanks for the help.

I have added the setting above to my package.json file. I then run sam build and tried to start a debug session and are getting the same error.

{
    "name": "delete-test-01",
    "description": "delete-test-01-description",
    "aws.samcli.enableCodeLenses": true,
    "version": "0.0.1",
    "private": true,
    "dependencies": {
        "@aws-sdk/client-dynamodb": "^3.188.0",
        "@aws-sdk/lib-dynamodb": "^3.188.0"
    },
    "devDependencies": {
        "aws-sdk-client-mock": "^2.0.0",
        "jest": "^29.2.1"
    },
    "scripts": {
        "test": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js"
    },
    "jest": {
        "testMatch": [
            "**/__tests__/**/*.[jt]s?(x)",
            "**/?(*.)+(spec|test).[jt]s?(x)",
            "**/__tests__/**/*.mjs?(x)",
            "**/?(*.)+(spec|test).mjs?(x)"
        ],
        "moduleFileExtensions": [
            "mjs",
            "js"
        ]
    }
}

from aws-toolkit-vscode.

jpinkney-aws avatar jpinkney-aws commented on August 19, 2024

Ah!

"aws.samcli.enableCodeLenses": true should actually be in your VSCode settings.json file

from aws-toolkit-vscode.

sm0ke21 avatar sm0ke21 commented on August 19, 2024

Hey @jpinkney-aws ,

That does the trick.

from aws-toolkit-vscode.

sm0ke21 avatar sm0ke21 commented on August 19, 2024

Thank you!

from aws-toolkit-vscode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.