Skip to content

docs(js): Update Nest.js installation method content #13765

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 28, 2025

Conversation

inventarSarah
Copy link
Collaborator

@inventarSarah inventarSarah commented May 20, 2025

DESCRIBE YOUR PR

Closes: #13525

  • Created an /install section for nestjs (in the project structure)
  • index page: added a section for Nest.js
  • CJS: removed content and linked to quick start guide
  • Nestjs will not display late-initialization.mdx file
  • updated "@sentry/node" to "@sentry/nestjs"
  • updated node --import commands for ESM

Please also review the installation method pages to see if we need to change anything else for Nest.js!

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

EXTRA RESOURCES

@inventarSarah inventarSarah requested review from mydea, Lms24 and chargome May 20, 2025 11:00
Copy link

vercel bot commented May 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 28, 2025 8:15am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
changelog ⬜️ Ignored (Inspect) Visit Preview May 28, 2025 8:15am
develop-docs ⬜️ Ignored (Inspect) Visit Preview May 28, 2025 8:15am

Copy link

codecov bot commented May 20, 2025

Bundle Report

Changes will increase total bundle size by 1.12kB (0.01%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sentry-docs-server-cjs 11.22MB 1.12kB (0.01%) ⬆️
sentry-docs-client-array-push 9.77MB -6 bytes (-0.0%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: sentry-docs-server-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
1729.js -3 bytes 1.75MB -0.0%
../instrumentation.js -3 bytes 1.08MB -0.0%
9523.js -3 bytes 1.05MB -0.0%
../app/[[...path]]/page.js.nft.json 378 bytes 398.68kB 0.09%
../app/platform-redirect/page.js.nft.json 378 bytes 398.59kB 0.09%
../app/sitemap.xml/route.js.nft.json 378 bytes 396.56kB 0.1%
view changes for bundle: sentry-docs-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
static/chunks/pages/_app-*.js -3 bytes 868.7kB -0.0%
static/chunks/8165-*.js -3 bytes 410.1kB -0.0%
static/bGAj0_PpMZFWkMWiDyPzb/_buildManifest.js (New) 616 bytes 616 bytes 100.0% 🚀
static/bGAj0_PpMZFWkMWiDyPzb/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/hYDfd3KA_J9G63a_GWoyf/_buildManifest.js (Deleted) -616 bytes 0 bytes -100.0% 🗑️
static/hYDfd3KA_J9G63a_GWoyf/_ssgManifest.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️

Co-authored-by: Charly Gomez <[email protected]>
…etsentry/sentry-docs into smi/nestjs/rework-installation-methods
Copy link
Member

@chargome chargome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Left some small suggestions

Comment on lines 31 to 36
Adjust the Node.js call for your application to use the [--import](https://nodejs.org/api/cli.html#--importmodule) parameter and point it at `instrument.mjs`, which contains your `Sentry.init()` code:

```bash
# Note: This is only available for Node v18.19.0 onwards.
node --import ./instrument.mjs dist/main.js
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Adjust the Node.js call for your application to use the [--import](https://nodejs.org/api/cli.html#--importmodule) parameter and point it at `instrument.mjs`, which contains your `Sentry.init()` code:
```bash
# Note: This is only available for Node v18.19.0 onwards.
node --import ./instrument.mjs dist/main.js
```
Adjust the start command for your application to use the [--import](https://nodejs.org/api/cli.html#--importmodule) parameter:
```bash
# Note: This is only available for Node v18.19.0 onwards.
"start": "--import ./instrument.mjs nest start"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chargome I will make the same update to the esm__v8.x.mdx file

Comment on lines 43 to 51
```javascript {filename: main.js}
// Import this first!
import "./instrument";

// Now import other modules
import http from "http";

// Your application code goes here
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```javascript {filename: main.js}
// Import this first!
import "./instrument";
// Now import other modules
import http from "http";
// Your application code goes here
```
```javascript {filename: main.ts}
// Import this first!
import "./instrument";
// Now import other modules
import { NestFactory } from '@nestjs/core';
// ...
// Your application code goes here

Most node applications today are either written in CommonJS (CJS), or compiled to CJS before running them.
CommonJS uses `require()` to load modules.

You can find installation instructions for CommonJS in the SDK's <PlatformLink to="/">Quick Start guide</PlatformLink>.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can find installation instructions for CommonJS in the SDK's <PlatformLink to="/">Quick Start guide</PlatformLink>.
You can follow the instructions in the SDK's <PlatformLink to="/">Quick Start guide</PlatformLink>.

});
```

Adjust the Node.js call for your application to use the [--import](https://nodejs.org/api/cli.html#--importmodule) parameter and point it at `instrument.mjs`, which contains your `Sentry.init()` code:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Adjust the Node.js call for your application to use the [--import](https://nodejs.org/api/cli.html#--importmodule) parameter and point it at `instrument.mjs`, which contains your `Sentry.init()` code:
Next, adjust the Node.js call for your application to use the [--import](https://nodejs.org/api/cli.html#--importmodule) parameter and point it at `instrument.mjs`, which contains your `Sentry.init()` code:

Copy link
Contributor

@coolguyzone coolguyzone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 😊

@inventarSarah inventarSarah merged commit 8519006 into master May 28, 2025
13 checks passed
@inventarSarah inventarSarah deleted the smi/nestjs/rework-installation-methods branch May 28, 2025 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nest.js: Rework installation method & exception filter documentation
3 participants