Skip to content

Sentry.Handlers.requestHandler migration steps required? #5282

@simllll

Description

@simllll

Is there an existing issue for this?

How do you use Sentry?

Self-hosted/on-premise

Which package are you using?

@sentry/node

SDK Version

7.2.0

Framework Version

No response

Link to Sentry event

No response

Steps to Reproduce

According to https://docs.sentry.io/platforms/node/guides/express/ and other docs,
we have this in our code base:

app.use(
	Sentry.Handlers.requestHandler({
		user: ['_id', 'source'],
		request: true,
		serverName: true,
		version: true
	})
);

but since the latest refactorings (d69cafc) this does not compile anymore, we get the following error:

TS2345: Argument of type '{ user: string[]; request: boolean; serverName: boolean; version: boolean; }' is not assignable to parameter of type 'RequestHandlerOptions'.   Object literal may only specify known properties, and 'user' does not exist in type 'RequestHandlerOptions'.

I looked into RequestHandlerOptions and found there a new child called "include":
image
Should I move user + request inside of include, and if yes, what happened to serverName and version, where can I specify them now?

Expected Result

Either a mirgation guide or it should work as before ;)

Actual Result

latest 7.2.0 is not compilable with config parameters for requestHandler

Metadata

Metadata

Assignees

Labels

Package: nodeIssues related to the Sentry Node SDK

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions