Skip to content

Support async configuration for SentryModule #16574

Answered by noook
noook asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks @Lms24 for your suggestions, I managed to run Sentry with Nest with the late init method as follows:

  1. Update package.json scripts to require the @sentry/node/preload.js
-    "start": "nest start",
-    "start:dev": "nest start --watch",
-    "start:debug": "nest start --debug --watch",
-    "start:prod": "node dist/main",
+    "start": "nest start -e \"node --import @sentry/node/preload\"",
+    "start:dev": "nest start --watch -e \"node --import @sentry/node/preload\"",
+    "start:debug": "nest start --debug --watch -e \"node --import @sentry/node/preload\"",
+    "start:prod": "node --import @sentry/node/preload dist/main",
  1. Create my own SentryModule
import { Global, Module } f…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@Lms24
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Lms24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants
Converted from issue

This discussion was converted from issue #16573 on June 12, 2025 18:00.