Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@sentry/astro": "* || latest",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@spotlightjs/astro": "2.1.6",
"astro": "4.13.3",
"astro": "4.16.8",
"typescript": "^5.5.4"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"dependencies": {
"@astrojs/cloudflare": "8.1.0",
"@sentry/astro": "latest || *",
"astro": "4.16.1"
"astro": "4.16.8"
},
"devDependencies": {
"@astrojs/internal-helpers": "0.4.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"@sentry/vite-plugin": "^2.22.6"
},
"devDependencies": {
"astro": "^3.5.0",
"astro": "^4.16.8",
Copy link
Member

Choose a reason for hiding this comment

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

We still support Astro 3.0.0 and upwards (https://docs.sentry.io/platforms/javascript/guides/astro/#prerequisites). I guess the build is failing because some types changed in v4?

Copy link
Member Author

Choose a reason for hiding this comment

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

I updated this to reflect v4.

I'd rather the package stays up-to-date with the latest version, and we use e2e tests to test against older versions when needed. What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

that makes sense to me IMHO!

"vite": "^5.4.10"
},
"scripts": {
Expand Down
10 changes: 5 additions & 5 deletions packages/astro/src/server/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
vercelWaitUntil,
winterCGRequestToRequestData,
} from '@sentry/utils';
import type { APIContext, MiddlewareResponseHandler } from 'astro';
import type { APIContext, MiddlewareHandler } from 'astro';

type MiddlewareOptions = {
/**
Expand Down Expand Up @@ -60,7 +60,7 @@ type AstroLocalsWithSentry = Record<string, unknown> & {
__sentry_wrapped__?: boolean;
};

export const handleRequest: (options?: MiddlewareOptions) => MiddlewareResponseHandler = options => {
export const handleRequest: (options?: MiddlewareOptions) => MiddlewareHandler = options => {
const handlerOptions = {
trackClientIp: false,
...options,
Expand All @@ -80,8 +80,8 @@ export const handleRequest: (options?: MiddlewareOptions) => MiddlewareResponseH
};

async function instrumentRequest(
ctx: Parameters<MiddlewareResponseHandler>[0],
next: Parameters<MiddlewareResponseHandler>[1],
ctx: Parameters<MiddlewareHandler>[0],
next: Parameters<MiddlewareHandler>[1],
options: MiddlewareOptions,
isolationScope?: Scope,
): Promise<Response> {
Expand Down Expand Up @@ -311,7 +311,7 @@ function tryDecodeUrl(url: string): string | undefined {
* We can check this by looking at the middleware's `clientAddress` context property because accessing
* this prop in a static route will throw an error which we can conveniently catch.
*/
function checkIsDynamicPageRequest(context: Parameters<MiddlewareResponseHandler>[0]): boolean {
function checkIsDynamicPageRequest(context: Parameters<MiddlewareHandler>[0]): boolean {
try {
return context.clientAddress != null;
} catch {
Expand Down
Loading
Loading