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
Duplicating script component when using rewrite rule in config.next.js #28538
Comments
I believe this is fixed in #28428 and released in next.js 11.1.1. An upgrade from 11.0.0 to 11.1.2 fixed the issue for me. |
@jflayhart could you check my codesandbox example please? It's already 11.1.2 but there is still duplicated script component. |
The documentation says an inline Script requires an id attribute with a value. Try adding one.
|
@jflheureux Ah ok I see, after adding id it's not duplicated. However, it's still strange when I need to put id to avoid duplication..... Thank you |
We cannot recreate the issue with the provided information. Please add a reproduction in order for us to be able to investigate. Why was this issue marked with the
|
This issue has been automatically closed because it wasn't verified against next@canary. If you think it was closed by accident, please leave a comment. If you are running into a similar issue, please open a new issue with a reproduction. Thank you. |
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. |
What example does this report relate to?
next/script + rewrite rule
What version of Next.js are you using?
11.1.0
What version of Node.js are you using?
15.7.0
What browser are you using?
Chrome
What operating system are you using?
Macos/Linux
How are you deploying your application?
use codesandbox https://codesandbox.io/s/old-flower-wx1zm?file=/next.config.js
Describe the Bug
I see 2 times of script being generated by next/script when I have rewrites rule in
next.config.js
Check following screenshot you have script with console.log 2 times being generated:
Please see the detail in codesandbox:
https://codesandbox.io/s/old-flower-wx1zm
Expected Behavior
only one script suppose be generated.
To Reproduce
_app.js
or and pages component by next/script ie: in _app.jsnext.config.js
and search for script tag
The text was updated successfully, but these errors were encountered: