AmyrAhmady / samp-node

a SA-MP plugin to run nodejs scripts
72 stars 8 forks source link

Is it possible to attach a debugger to samp-node? #9

Open SelfRecursion opened 3 years ago

SelfRecursion commented 3 years ago

I've started developing a framework to ease up gamemode developments with this plugin, and I've been loving to work with it so far! But since I'm still a bit new with VS Code and node apps, I would like to know if somebody knows a way to debug developments, without constantly having to define console.logs, or if there is an easier alternative. Thanks in advance!

alextwothousand commented 3 years ago

Try TypeScript. With typings you'll avoid a lot of those pesky dynamic language-plagued bugs.

Alex Rahali E // @. @./0?redirect=mailto%3Aalexrahali4%40gmail.com&recipient=cmVwbHkrQUpJRUNYR0JaS1pCSFBCN1hXQ1FPTU42TEk0RExFVkJOSEhEREM0Q09NQHJlcGx5LmdpdGh1Yi5jb20%3D) W // https://alexdev.site @.***/1?redirect=https%3A%2F%2Falexdev.site&recipient=cmVwbHkrQUpJRUNYR0JaS1pCSFBCN1hXQ1FPTU42TEk0RExFVkJOSEhEREM0Q09NQHJlcGx5LmdpdGh1Yi5jb20%3D)

On Mar 14 2021, at 6:34 pm, Daniel Branco @.***> wrote:

I've started developing a framework to ease up gamemode developments with this plugin, and I've been loving to work with it so far! But since I'm still a bit new with VS Code and node apps, I would like to know if somebody knows a way to debug developments, without constantly having to define console.logs, or if there is an easier alternative. Thanks in advance! — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub @./2?redirect=https%3A%2F%2Fgithub.com%2FAmyrAhmady%2Fsamp-node%2Fissues%2F9&recipient=cmVwbHkrQUpJRUNYR0JaS1pCSFBCN1hXQ1FPTU42TEk0RExFVkJOSEhEREM0Q09NQHJlcGx5LmdpdGh1Yi5jb20%3D), or unsubscribe @./3?redirect=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAJIECXFJF6ZUO3BYIKC7CUDTDT6TLANCNFSM4ZFHYZFQ&recipient=cmVwbHkrQUpJRUNYR0JaS1pCSFBCN1hXQ1FPTU42TEk0RExFVkJOSEhEREM0Q09NQHJlcGx5LmdpdGh1Yi5jb20%3D).

tmfksoft commented 2 years ago

I've looked into this just now for the same reason. Just to help towards development.

When enabling it with the following code:

        const inspector = require('node:inspector');
        inspector.open();

It fails with the following error:

Error [ERR_INSPECTOR_NOT_AVAILABLE]: Inspector is not available

No idea why this is happening, would be useful to allow attaching an external debugger.

danjdewhurst commented 2 years ago

This uses a 32 bit build of node which doesn’t include any debugging tools.