#support

Troubleshooting Node App Instrumentation with Signoz

TLDR Romario encountered a "TypeError" while following a guide to instrument a node app, discovered that sdk.start() is not a promise, and resolved the issue using the init option.

Powered by Struct AI
+11
7
5mo
Solved
Join the chat
Apr 12, 2023 (5 months ago)
Romario
Photo of md5-6c7925cd4df7e39b036d2b26fb21013d
Romario
07:31 PM
Hello! I’m trying to instrument a node app, using the guide from the website I get:
> [email protected] start
> TS_NODE_BASEURL=./build node -r tsconfig-paths/register build/src/tracing.js build/src/main.js

/Users/rlopez/repos/gitstart/gateway/build/src/tracing.js:35
  .then(() => console.log("Tracing initialized"))
  ^

TypeError: Cannot read properties of undefined (reading 'then')
    at Object.<anonymous> (/Users/rlopez/repos/gitstart/gateway/build/src/tracing.js:35:3)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47

Node.js v18.4.0
07:31
Romario
07:31 PM
Does someone has an idea what could be wrong?
07:34
Romario
07:34 PM
Seems that sdk.start() is undefined
07:36
Romario
07:36 PM
I think start() type changed, is not a promise anymore 🤔
07:41
Romario
07:41 PM
Now it works but my server doesn’t start
Palash Gupta
Photo of md5-051f535431ff484f44f165e9a0b696a5
Palash Gupta
07:50 PM
vishal-signoz
Romario
Photo of md5-6c7925cd4df7e39b036d2b26fb21013d
Romario
07:56 PM
I went with the init option, is working
+11