-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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/script
not working in custom Document
when outside of next/document
's <Head>
#37741
Comments
It seems that there are succeeding tests for this: Related: |
There's an issue currently that requires
I'll submit a PR next week that removes this restriction and allow you to place |
Thank you, @housseindjirdeh! Yeah, I can verify that. Is it ok if I try to work on this and submit a PR? |
<Script strategy="beforeInteractive" />
not doing anything in _document.js
<Script strategy="beforeInteractive" />
not doing anything in _document.js
when outside of <Head>
@aboqasem Go for it! I was meaning to work on it next week but will be glad to help you and review your PR instead :) |
<Script strategy="beforeInteractive" />
not doing anything in _document.js
when outside of <Head>
next/script
not working in custom Document
when outside of next/document
's <Head>
…ercel#37741" This reverts commit 5cdc750.
…ercel#37741" This reverts commit 5cdc750.
Fixes #37741. Allows `next/script` to be placed inside of `_document` body in addition to `Head`. ## Bug - [X] Related issues linked using `fixes #number` - [X] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md`
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)
No response
How are you deploying your application? (if relevant)
next start
Describe the Bug
I am trying to get
<Script strategy="beforeInteractive" />
to work, I did exactly what the docs say, but the script is not present in the builtindex.html
nor working innext dev
.Expected Behavior
<Script strategy="beforeInteractive" />
to work.To Reproduce
_document.js
DevTools > Network
https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.20/lodash.min.js
Or from a shell terminal:
The text was updated successfully, but these errors were encountered: