Skip to content

outputStandalone breaking with middleware #32930

@nil1511

Description

@nil1511

What version of Next.js are you using?

12.0.8-canary.13

What version of Node.js are you using?

16.13.1

What browser are you using?

Chrome

What operating system are you using?

macOS

How are you deploying your application?

Vercel

Describe the Bug

When using experimental.outputStandalone with middlewares, yarn build is breaking. since nft.json file is not generated for middleware.

[Error: ENOENT: no such file or directory, open '~/next.js/examples/with-docker/.next/server/pages/_middleware.js.nft.json'] {

Expected Behavior

yarn build to succeed and tracing files for middleware to be generated.

To Reproduce

create pages/_middleware.js in with-docker example and then yarn build is breaking

import { NextResponse } from 'next/server'

export function middleware(req, ev) {
  return NextResponse.next()
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions