-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Meta: Help WantedPackage: nextjsIssues related to the Sentry Nextjs SDKIssues related to the Sentry Nextjs SDK
Description
- Review the documentation: https://docs.sentry.io/
- Search for existing issues: https://github.com/getsentry/sentry-javascript/issues
- Use the latest release: https://github.com/getsentry/sentry-javascript/releases
- Provide a link to the affected event from your Sentry account
Package + Version
- other:
sentry/nextjs
Version:
6.17.4
Description
Any _middleware.ts file inside the /pages/api directory receives sentry-related code in the outputted file. This is not the case as soon as you move this _middleware.ts file outside this api directory.
As a result the function runtime throws an error because sentry tries to access the window:
/Volumes/[...]/.next/server/pages/api/_middleware.js:6121
var manualScrollRestoration = true && 'scrollRestoration' in window.history && !!function() {
^
ReferenceError: window is not definedMetadata
Metadata
Assignees
Labels
Meta: Help WantedPackage: nextjsIssues related to the Sentry Nextjs SDKIssues related to the Sentry Nextjs SDK