{"action":"created","issue":{"url":"https://api.github.com/repos/nuxt/nuxt.js/issues/3396","repository_url":"https://api.github.com/repos/nuxt/nuxt.js","labels_url":"https://api.github.com/repos/nuxt/nuxt.js/issues/3396/labels{/name}","comments_url":"https://api.github.com/repos/nuxt/nuxt.js/issues/3396/comments","events_url":"https://api.github.com/repos/nuxt/nuxt.js/issues/3396/events","html_url":"https://github.com/nuxt/nuxt.js/issues/3396","id":327735486,"node_id":"MDU6SXNzdWUzMjc3MzU0ODY=","number":3396,"title":"Nuxt not load exernal script when user come by $router ","user":{"login":"furyscript","id":10270403,"node_id":"MDQ6VXNlcjEwMjcwNDAz","avatar_url":"https://avatars0.githubusercontent.com/u/10270403?v=4","gravatar_id":"","url":"https://api.github.com/users/furyscript","html_url":"https://github.com/furyscript","followers_url":"https://api.github.com/users/furyscript/followers","following_url":"https://api.github.com/users/furyscript/following{/other_user}","gists_url":"https://api.github.com/users/furyscript/gists{/gist_id}","starred_url":"https://api.github.com/users/furyscript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/furyscript/subscriptions","organizations_url":"https://api.github.com/users/furyscript/orgs","repos_url":"https://api.github.com/users/furyscript/repos","events_url":"https://api.github.com/users/furyscript/events{/privacy}","received_events_url":"https://api.github.com/users/furyscript/received_events","type":"User","site_admin":false},"labels":[{"id":882702378,"node_id":"MDU6TGFiZWw4ODI3MDIzNzg=","url":"https://api.github.com/repos/nuxt/nuxt.js/labels/cmty:bug-report","name":"cmty:bug-report","color":"f7b2c0","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-05-30T13:39:15Z","updated_at":"2018-06-08T15:41:59Z","closed_at":null,"author_association":"NONE","body":"### Version\n\n[v1.4.0](https://github.com/nuxt/nuxt.js/releases/tag/v1.4.0)\n\n### Reproduction link\n\n[http://codesandbox.io/#](http://codesandbox.io/#)\n\n### Steps to reproduce\n\nJust put external script by using `head` into vue-router component.\n\nLike this\n```\n\n  head () {\n    return {\n      title: 'test',\n      meta: [\n        { hid: 'description', name: 'description', content: 'test' }\n      ],\n      script: [\n        { src: 'https://www.paypalobjects.com/api/checkout.min.js' },\n        { src: 'https://checkout.stripe.com/checkout.js' }\n      ]\n    }\n  }\n```\nNow if you navigate from another route by `<nuxt-link` to the page that have this external script, if you put a `console.log(paypal)` into `created` is undefined (infact if you inspect element the scripts into head aren't loaded). But if you press `f5` the scripts are correctly loaded.\nHow can I do this because I need this scripts in only one page \n\n### What is expected ?\n\nLoad external script in one page correctly\n\n### What is actually happening?\n\nNot load external script if you come by `$router` plugin\n\n<!--cmty--><!--cmty_prevent_hook-->\n<div align=\"right\"><sub><em>This bug report is available on <a href=\"https://nuxtjs.cmty.io\">Nuxt.js</a> community (<a href=\"https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c7178\">#c7178</a>)</em></sub></div>"},"comment":{"url":"https://api.github.com/repos/nuxt/nuxt.js/issues/comments/395801517","html_url":"https://github.com/nuxt/nuxt.js/issues/3396#issuecomment-395801517","issue_url":"https://api.github.com/repos/nuxt/nuxt.js/issues/3396","id":395801517,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NTgwMTUxNw==","user":{"login":"furyscript","id":10270403,"node_id":"MDQ6VXNlcjEwMjcwNDAz","avatar_url":"https://avatars0.githubusercontent.com/u/10270403?v=4","gravatar_id":"","url":"https://api.github.com/users/furyscript","html_url":"https://github.com/furyscript","followers_url":"https://api.github.com/users/furyscript/followers","following_url":"https://api.github.com/users/furyscript/following{/other_user}","gists_url":"https://api.github.com/users/furyscript/gists{/gist_id}","starred_url":"https://api.github.com/users/furyscript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/furyscript/subscriptions","organizations_url":"https://api.github.com/users/furyscript/orgs","repos_url":"https://api.github.com/users/furyscript/repos","events_url":"https://api.github.com/users/furyscript/events{/privacy}","received_events_url":"https://api.github.com/users/furyscript/received_events","type":"User","site_admin":false},"created_at":"2018-06-08T15:41:58Z","updated_at":"2018-06-08T15:41:58Z","author_association":"NONE","body":"I resolve the issue by put the script globally into `nuxt.config` and set `defer` so the page doesn't have a render blocking `script`.\r\nBefore I tried to put external scripts only in the page where I need to use that, but without success as I explain in this issue..."}}
{"actor":{"display_login":"furyscript"}}