Comments (7)
Hey @samcx, I hope it's ok for me to chime in.
I've tested with the latest canary and am observing the same behavior as you do: In development, only the React optimization header value for Link
shows up and after a production build, only a manually set value for Link
is returned (in this case set by next-intl
).
There are two aspects here that worry me a bit:
- Even when I bump
reactMaxHeadersLength
to a value like999999999
, the behavior is exactly the same. Could it be, that a logic for merging headers is missing here? That's at least what I'd hope to exist and I guess there's a need for both: proper i18n links as well as performance optimization. - A
Link
response header being overridden in development is quite unfortunate. While I'm happy that it still exists in production, I'd assume this to be rather confusion for developers who want to verify the header is there. Note that theLink
response header in the i18n use case is not an optimization, but a necessary signal to search engines to link together multilingual pages. The absence of this header could result in search engines recognizing variants of pages as duplicates and de-indexing them. Therefore this is quite a crucial functionality.
Any chance we could get to the bottom of this and see if there's something to be adjusted in Next.js to work correctly?
from next.js.
Awesome, thanks a lot @samcx!
from next.js.
@zenzen-sol I am also seeing that on next dev
.
I think what is probably happening is these i18n
headers are working differently in next build
. (locally using next build
, it shows).
It's tough to say why it gets flipped and explain why next/font
doesn't show on next build
, but I do know React is making these decisions to best organize what to preload first.
In the meantime, I will be closing this issue!
from next.js.
@zenzen-sol This is likely because the headers size was limited, so next/font
was taking precedence.
We expanded these headers →
I am taking a look to confirm!
from next.js.
Despite the headers size increase, I only see the next-intl
's link headers, which probably makes sense (React calculates what is the best items to add to the link headers).
from next.js.
@samcx I can confirm that I'm seeing the same when deploying to Vercel. At this point, I'll assume that the correct header will be set, although I haven't found any way to confirm it locally. (Still seeing only the font optimization headers when running in dev.)
Thanks for looking into this!
from next.js.
@amannn Thank you for the clarification! I should have also checked next-intl
when next/font
wasn't present. When next/font
isn't present, the next-intl
Link Headers do show up in next dev
.
Not sure if it's getting "replaced," but I have shared this with our team!
from next.js.
Related Issues (20)
- Not able to add Videos Tag in Sitemap.xml using app router
- Third-party script synchronous loading Hydration problem
- hydrate not finished until the whole content is loaded at Stream SSR mode
- Draft mode cookie no being set on edge runtime HOT 2
- Image optimizer rejects requests for remote images with _next/image in the URL (v14.2.7)
- ScrollAndFocusHandler incompatibility with AG Grid
- Docs: On Firefox, with dom.enable_performance_observer set to false, https://nextjs.org/ crashes
- Docs: location of cached images is wrong
- Third-party script synchronous loading Hydration problem
- Inconsistent handling of notFound() from server action
- Importing Next.js Link component in Route Handler results in "Could not parse module"
- Critical bug in NextJS v14.2.7 - renders page source code instead of components HOT 1
- Next v14 Double Render HOT 1
- Turbopack: `resourceQuery` from import isn't passed to loaders HOT 1
- Docs: Documentation incorrectly says database calls will opt in to server side rendering by default
- Docs: geolocation is confusing (w/vercel) - why is req.geo only available on middlewere
- Error: headers was called outside a request scope, when using Authjs v5.0.0-beta.19 and next dev --turbo
- Import .ts files in Instrumentation HOT 1
- Duplicate className in deploy-button.tsx causing Tailwind CSS error in with-supabase example
- [SWC] [Webpack] [Tree Shaking] combines exports of modules and constants across pages HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from next.js.