Skip to content

"Failed to copy traced files" warning in output standalone when using appDir under a router group #43783

@ludusrusso

Description

@ludusrusso

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 22.1.0: Sun Oct  9 20:15:09 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T6000
Binaries:
  Node: 16.14.0
  npm: 8.3.1
  Yarn: 1.22.17
  pnpm: N/A
Relevant packages:
  next: 13.0.7-canary.1
  eslint-config-next: 13.0.6
  react: 18.2.0
  react-dom: 18.2.0

Which area(s) of Next.js are affected? (leave empty if unsure)

App directory (appDir: true), Standalone mode (output: "standalone")

Link to the code that reproduces this issue

https://github.com/ludusrusso/next-fail-output-standalone-build-app-dir

To Reproduce

run npm run build in the example code

Describe the Bug

When using output standalone with appDir, pages under router groups generates this warning:

warn  - Failed to copy traced files for /Users/ludusrusso/develop/github.com/ludusrusso/next-fail-output-standalone-build-app-dir/.next/server/app/test/page.js [Error: ENOENT: no such file or directory, open '/Users/ludusrusso/develop/github.com/ludusrusso/next-fail-output-standalone-build-app-dir/.next/server/app/test/page.js.nft.json'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/ludusrusso/develop/github.com/ludusrusso/next-fail-output-standalone-build-app-dir/.next/server/app/test/page.js.nft.json'
}

Anyway, the file is present in the standalone build in the correct place and the page works correcly.

Screenshot 2022-12-06 alle 18 44 15

Expected Behavior

The warning should disappear.

I think that there is an error in the path copy, it should be (in the example)

.next/server/app/(test)/test/page.js.nft.json'

instead of

.next/server/app/test/page.js.nft.json'

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue was opened via the bug report template.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions