-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Closed
Labels
MetadataRelated to Next.js' Metadata API.Related to Next.js' Metadata API.OutputRelated to the the output configuration option.Related to the the output configuration option.bugIssue was opened via the bug report template.Issue was opened via the bug report template.
Description
Verify canary release
- I verified that the issue exists in the latest Next.js canary release
Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: #1 SMP Fri Jan 27 02:56:13 UTC 2023
Binaries:
Node: 18.11.0
npm: 8.19.2
Yarn: 1.22.19
pnpm: 7.28.0
Relevant packages:
next: 13.3.3-canary.0
eslint-config-next: N/A
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/darthmaim/reproduction-next-icon-standalone
To Reproduce
- checkout https://github.com/darthmaim/reproduction-next-icon-standalone
- verify manually
npm i
npm run build
- Open
.next/standalone/.next/server/app/icon.svg/route.js
and see it contains an absolute path to the source file
- verify with
with-docker
example:docker build -t reproduction-next-icon-standalone .
docker run -p 3000:3000 reproduction-next-icon-standalone
- Open http://localhost:3000/, see there is no favicon
- Inspect source, find
<link rel="icon" ...
in thehead
and open its url in a new tab - See "Internal Server Error"
- See
Error: ENOENT: no such file or directory, open '/app/app/icon.svg'
in docker log
Describe the Bug
When using icon.svg
(other meta files might be affected as well) they are not included in the standalone output. Instead the standalone output references absolute paths in the source directory.
This works when running the standalone build on the same machine that build it, but breaks if the standalone build is for example included in docker.
The reproduction includes the Dockerfile from the with-docker
example to visualize this.
Expected Behavior
The standalone output should contain the icon.svg file and the icon.svg/route
should not include an absolute path to the source directory.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
standalone
BigOoga, darthmaim and JasperAlexanderJesseKoldewijn
Metadata
Metadata
Assignees
Labels
MetadataRelated to Next.js' Metadata API.Related to Next.js' Metadata API.OutputRelated to the the output configuration option.Related to the the output configuration option.bugIssue was opened via the bug report template.Issue was opened via the bug report template.