Giter VIP home page Giter VIP logo

Comments (4)

simoami avatar simoami commented on May 16, 2024 1

Thanks @AnandChowdhary
For anyone else looking to run in debug mode, here's the vs code config that worked for me:

.vscode/launch.json

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Debug",
      "skipFiles": [
        "<node_internals>/**"
      ],
      "program": "${workspaceFolder}/dist/src/__staart.js",
      "preLaunchTask": "Build"
    }
  ]
}

.vscode/tasks.json

{
  "version": "2.0.0",
  "command": "tsc",
  "type": "shell",
  "tasks": [
    {
      "label": "Build",
      "type": "shell",
      "command": "yarn",
      "args": [
        "build"
      ],
    }
  ],
  "reveal": "always"
}

from api.

AnandChowdhary avatar AnandChowdhary commented on May 16, 2024

Hi @simoami, this should not be the case, let me help you find what's not working here.

First, I'd like to make sure you're on the most recent version of Staart API. You can check that by making sure "staart-version" in your package.json is "1.3.150". If this is not the case, you can update Staart API by entering staart update api in your console.

Then, make sure all dependencies are installed. We have several new dependencies that make sure the raw payload is processed as JSON and returned, so your example should be working. That logic comes from here: https://github.com/staart/packages/blob/master/packages/server/index.ts#L22 in package @staart/scripts. Make sure you've run npm install to get these new packages.

Can you please confirm you've this is all done, and then we can add some console.logs in your handler and see where this breaks down.

from api.

simoami avatar simoami commented on May 16, 2024

Hi @AnandChowdhary
I pulled the latest update, wiped node_modules and reinstalled from scratch. It works with yarn start
However, I noticed my issue is with starting the server in debug mode in vs code. This config is what's causing the requests to stall:

launch.json

  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Launch Program",
      "skipFiles": [
        "<node_internals>/**"
      ],
      "program": "${workspaceFolder}/dist/src/__staart.js",
      "preLaunchTask": "tsc: build - tsconfig.json",
      "outFiles": [
        "${workspaceFolder}/dist/**/*.js"
      ]
    }
  ]

Update: After removing the preLaunchTask line, it works. So I'm assuming the tarn build has more to it than just tsc compiling.

Do you happen to use vscode? If so what config/script can be directly invoked with the node command?

from api.

AnandChowdhary avatar AnandChowdhary commented on May 16, 2024

That's correct, @simoami, the yarn build script does (much) more than tsc. It compiles TypeScript, generates controllers, appends middleware, and so on.

The script you want to run is staart build.

from api.

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.