Skip to content

Global error page installed by wizard causes TypeScript compilation errors during Next 14 build step #12520

@benvinegar

Description

@benvinegar

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/browser

SDK Version

8.9.2

Framework Version

Next.js 14.1.4

Link to Sentry event

No response

SDK Setup

This is using a basic wizard install with no additional customization.

Steps to Reproduce

  1. Follow the wizard steps (I used npx @sentry/wizard@latest -i nextjs)
  2. Add the example error page (src/app/global-error.tsx)
  3. After the wizard is finished, attempt to run npm run build

Expected Result

Adding Sentry shouldn't cause npm run build on my project to fail.

Actual Result

Instead it causes a bunch of TypeScript compilation errors which cause the build to not complete.

Linting and checking validity of types  .Failed to compile.

./src/app/global-error.tsx:7:39
Type error: Binding element 'error' implicitly has an 'any' type.

   5 | import { useEffect } from "react";
   6 |
>  7 | export default function GlobalError({ error }) {
     |                                       ^
   8 |   useEffect(() => {
   9 |     Sentry.captureException(error);
  10 |   }, [error]);

Metadata

Metadata

Assignees

Labels

Package: nextjsIssues related to the Sentry Nextjs SDK

Projects

Status

Waiting for: Product Owner

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions