-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Allow inline-scripts with beforeInteractive
strategy
#34610
Comments
Oh, it seems It seems the documentation is inaccurate then. External scripts are not "inlined" either - at least my understanding of inlining would be fetching the remote script text and embedding it directly in the HTML to avoid a network fetch, which I don't see happening at all. |
This use case was purposefully left out from the initial implementation. As such, this sounds like a duplicate of #26343. Do you agree? |
Yep, happy to close as duplicate. |
@pacocoursey you could also just move to a regular script tag in |
Yeah, that's what I'm planning to do 👍 (pacocoursey/next-themes#89) |
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. |
Describe the feature you'd like to request
My library
next-themes
injects an inline script that must at the start of page load to avoid any color flashing. This means I must use thebeforeInteractive
strategy innext/script
.However,
beforeInteractive
does not support inline scripts:I'd like to request that inline scripts should be supported in
next/script
withstrategy="beforeInteractive"
.Describe the solution you'd like
Allow passing
dangerouslySetInnerHTML
orchildren
alongside usages of the script component withstrategy="beforeInteractive"
.Implementation strategy:
dangerouslySetInnerHTML
orchildren
toscripts.beforeInteractive
on this line_document
Describe alternatives you've considered
src
prop. This is what I'm currently doing, but it means we cannot have a stable, secure way to allow the script via CSP.The text was updated successfully, but these errors were encountered: