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

Response headers in next.js config are not applied to standalone/_next/static (when i18n is configured) #54159

Closed
1 task done
cosieLq opened this issue Aug 17, 2023 · 4 comments
Labels
bug Issue was opened via the bug report template. locked Output (export/standalone) Related to the the output option in `next.config.js`.

Comments

@cosieLq
Copy link

cosieLq commented Aug 17, 2023

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 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

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

@cosieLq cosieLq added the bug Issue was opened via the bug report template. label Aug 17, 2023
@github-actions github-actions bot added the Output (export/standalone) Related to the the output option in `next.config.js`. label Aug 17, 2023
@michaelangeloio

This comment has been minimized.

@cosieLq 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
@cosieLq
Copy link
Author

cosieLq commented Sep 11, 2023

When will this issue be triaged?

@ztanner
Copy link
Member

ztanner commented Dec 4, 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!

@ztanner ztanner closed this as not planned Won't fix, can't repro, duplicate, stale Dec 4, 2023
Copy link
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. locked Output (export/standalone) Related to the the output option in `next.config.js`.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants