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
next/head order changed #34885
Comments
Are you seeing any issues that are a consequence of this? |
yes, we had some script order issues. We moved the specific code to |
I believe this is the relevant PR: #28119 Could you share your code? |
Here is a simplified version for our consent management (broken version): <!-- _document.tsx -->
<script>
window.loadOnConsent = (listOfScripts) => {}; // a script loader
</script> // _app.tsx
<Head>
<script dangerouslySetInnerHTML={{ __html: `window.loadOnConsent(${JSON.stringify(getScriptsThatNeedConsent(config))})` }} />
</Head> I know there is the |
For this exact case there is the
https://nextjs.org/docs/basic-features/script#beforeinteractive |
@balazsorban44 it has nothing to do with |
It is, because it gives the guarantees for your requirements. I don't understand why it would not work, as the mentioned strategy is optimized for your use case. But to make sure if we have a different recommendation, I'll ask the rest of the team. 👍 |
Here are some reasons why
I have a wishlist for
|
Google Tag Manager snippet code was inserted in my case at the end of other meta tags, which caused the same problem. |
Hi, colleague of @bobaaaaa 's here, this is what we came up with: https://github.com/LukasBombach/next-inline-script we are using a child compiler and a webpack loader to compile and place some parts of our code in the |
This is a bug report of unexpected change, but it's not actually a bug in itself. |
This closed issue has been automatically locked because it had no new activity for a month. 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
What browser are you using? (if relevant)
firefox, chrome
How are you deploying your application? (if relevant)
No response
Describe the Bug
If I add a
<Head />
component in_app.js
,_document.js
and a page, the order of tags changed from next 12.0.10 to 12.1.0. I created an example repo.head order next@canary
v12.1.1-canary.4
head order next 12.1.0
head order next 12.0.10
Expected Behavior
It's either a bug or this "feature" is not mentioned anywhere (release notes). In my opinion, the next 12.0.10 version is correct and this is a bug.
To Reproduce
https://github.com/bobaaaaa/next-bug-head
The text was updated successfully, but these errors were encountered: