You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cosieLq
changed the title
Response headers in next.js config are not applied to standalone/.next/static (when i18n is configured)
Response headers in next.js config are not applied to standalone/_next/static (when i18n is configured)
Sep 6, 2023
Hi, as per the docs here, if you don't specify locale: false on these headers, each source is automatically prefixed to handle the configured locales. Since /_next/static is not locale specific, these files won't be matched unless you make this configuration change.
Going to close this out but feel free to ping if it seems like this is still not working after making this change!
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Verify canary release
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #1 SMP Wed Mar 2 00:30:59 UTC 2022 Binaries: Node: 18.12.1 npm: 8.19.2 Yarn: 3.6.1 pnpm: N/A Relevant Packages: next: 13.4.17-canary.1 eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0 typescript: 5.1.3 Next.js Config: output: standalone
Which area(s) of Next.js are affected? (leave empty if unsure)
App Router, Standalone mode (output: "standalone")
Link to the code that reproduces this issue or a replay of the bug
https://github.com/cosieLq/exampleApp_nextjs/tree/reproduction-missing-headers
To Reproduce
yarn install
and thennext build
Describe the Bug
The headers (Cache-Control and other options mentioned here: https://nextjs.org/docs/pages/api-reference/next-config-js/headers#options) are correctly set for /public.
But they are missing for .next/static.
Expected Behavior
Headers in next.config are applied to .next/static as well.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
The text was updated successfully, but these errors were encountered: