next.js
next.js copied to clipboard
Link tags do not populate Scripts on renavigation
Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
Provide environment information
Refer to #42088
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
Refer to #42088
The script will only be fetched and executed when this specific page is loaded on the browser.
https://user-images.githubusercontent.com/22056864/198799157-2093bfcb-870c-4fd6-9f5f-1c0c767af619.mov
If you need to execute some code after the script has loaded, you can check out the onLoad or onReady event callbacaks.
That is the only main script that is supposed to be loaded... Which is not being loaded using link as noted in the recording.
It has been an issue since 2018. Unless I missed something from the docs that say there is another way to handle this..
#42088 has been closed too early.
Currently I am using a tag which refreshes the page, where as link tag doesnt Which is the main reason IMO this doesnt load it.
Expected Behavior
Refer to #42088
Link to reproduction
https://github.com/temrb/next-link-issue
To Reproduce
https://github.com/temrb/next-link-issue