Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

outputStandalone breaking with middleware #32930

Closed
nil1511 opened this issue Jan 1, 2022 · 2 comments · Fixed by #32967
Closed

outputStandalone breaking with middleware #32930

nil1511 opened this issue Jan 1, 2022 · 2 comments · Fixed by #32967
Assignees

Comments

@nil1511
Copy link
Contributor

nil1511 commented Jan 1, 2022

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()
}
@nil1511 nil1511 added the bug Issue was opened via the bug report template. label Jan 1, 2022
@nil1511
Copy link
Contributor Author

nil1511 commented Jan 3, 2022

Hi @ijjk and @styfle, will middleware always inline external dependencies? if so, can we exclude middleware while copying trace files

await copyTracedFiles(
            dir,
            distDir,
            [...pageKeys.filter(page=> !page.match(MIDDLEWARE_ROUTE))],
            outputFileTracingRoot,
            requiredServerFiles.config
          )

@ijjk ijjk changed the title outputFileTracing breaking with middleware outputStandalone breaking with middleware Jan 3, 2022
@styfle styfle added kind: bug and removed bug Issue was opened via the bug report template. labels Jan 4, 2022
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Feb 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants