Standalone debug adapter protocol for react native. Hopefully won't have any specific editor/ide stuff
git clone git@github.com:sultanahamer/nvim-dap-reactnative.git
-- using modules
M.config = {
adapters = {
type = "executable",
command = "node",
args = { dbg_path .. "vscode-node-debug2/out/src/nodeDebug.js" },
},
configurations = {
{
type = "node2",
request = "attach",
program = "${file}",
cwd = fn.getcwd(),
sourceMaps = true,
protocol = "inspector",
console = "integratedTerminal",
port = 35000
},
},
}
-- OR
-- directly - typescript react example
dap.adapters.node2 = {
type = "executable",
command = "node",
args = { os.getenv("HOME") .. "/vscode-node-debug2/out/src/nodeDebug.js" },
}
dap.configurations.typescriptreact = {
{
name = "React native",
type = "node2",
request = "attach",
program = "${file}",
cwd = vim.fn.getcwd(),
sourceMaps = true,
protocol = "inspector",
console = "integratedTerminal",
port = 35000,
},
}
tsc
from the debuggers directory inside this project's directory.RN_DEBBUGER_WD=<project_directory> node src/standalone.js
:lua require('dap').continue()
.:lua require('dap').continue()
, it will again stop on another unknown location, do continue. Now it should start hitting the app's breakpoints:lua require('dap').close()
Open emulator and hit rr, it will refresh and wait on white screen Do dap_continue or runlast and you are good to go👤 sultanahamer
Give a ⭐️ if this project helped you!