- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.7k
 
Closed
Description
Environment
SaaS (https://sentry.io/)
Steps to Reproduce
npx create-next-app sentry-test. Create a new NextJS app with default values except thesrcdirectory (selectNo)
- ✔ Would you like to use 
src/directory? … No 
cd sentry-test. Enter to the directorynpx @sentry/wizard@latest -i nextjs. Run the sentry wizard- create a 
middleware.tsfile (inside ./) that sends some traces to sentry, for example: 
// ./middleware.ts
import {NextResponse} from 'next/server';
import * as Sentry from '@sentry/nextjs';
import type {NextRequest} from 'next/server';
export const middleware = (request: NextRequest): NextResponse => {
    Sentry.captureException(new Error('Sentry Example Middleware Error'));
    Sentry.captureMessage('Sentry Example Middleware Message', {
        level: 'info',
        extra: {
            method: request.method,
            path: request.nextUrl.pathname,
        },
    });
    console.log(request.method + ' ' + request.nextUrl.pathname);
    return NextResponse.next();
};yarn dev. Run the dev server and openhttp://localhost:3000
Expected Result
Receive issues from the middleware
We can verify that the middleware gets executed by looking at the console.logs from the terminal
Actual Result
Not receiving issues from middleware
Product Area
Unknown
Link
No response
DSN
No response
Version
No response
Metadata
Metadata
Assignees
Labels
No labels
Projects
Status
No status