-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Loading external scripts using head property inside component doesn't load the script if server side rendered #6005
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
Comments
Could you please create a working reproduction of this issue on codesandbox that we can check? |
Yes sure. I'll create one and update. |
Offtopic, but you probably don't want to include scripts in head. You can add them to body inside no-ssr tag. |
@pimlie https://codesandbox.io/s/codesandbox-nuxt-rg5zj?fontsize=14. @TrueCarry Thanks, I'll try that also. And i'll have to do the same for external css too i guess. |
Do I understand correctly you expect that |
@pimlie No. I meant that temporary.js should be loaded in the index page. Not about page. But its not loading in the index page also if you reload the page and if the page is rendered from server side. It is loaded only if the page is rendered client side (i.e - go to any other page and come back on index page using navigation via nuxt-link, then it'll load temporary.js). |
I checked it again. Its NOT loading. I'll post a screen recording video. Can you also please guide me where to look for the code of nuxtJs related to loading these scripts. |
Thanks for your contribution to Nuxt.js!
Issues that are labeled as |
Version
v2.8.1
Reproduction link
https://jsfiddle.net/wbr3gunq/1/
Steps to reproduce
Add external scripts in head() method of the component.
Come to this page buy navigating from another page using nuxt-link. This will load the scripts. But if you hit Ctrl+R or reload the page, the scripts are not loaded.
What is expected ?
It should load external scripts when rendered server side or client side.
What is actually happening?
The external script tags are not loaded when page is rendered server side.
The text was updated successfully, but these errors were encountered: