{"action":"created","issue":{"url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/988","repository_url":"https://api.github.com/repos/gatsbyjs/gatsby","labels_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/988/labels{/name}","comments_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/988/comments","events_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/988/events","html_url":"https://github.com/gatsbyjs/gatsby/issues/988","id":229651120,"number":988,"title":"[1.0] Preloader script prefixes not acting as intended when sourcemaps are disabled","user":{"login":"scottyeck","id":3766777,"avatar_url":"https://avatars3.githubusercontent.com/u/3766777?v=3","gravatar_id":"","url":"https://api.github.com/users/scottyeck","html_url":"https://github.com/scottyeck","followers_url":"https://api.github.com/users/scottyeck/followers","following_url":"https://api.github.com/users/scottyeck/following{/other_user}","gists_url":"https://api.github.com/users/scottyeck/gists{/gist_id}","starred_url":"https://api.github.com/users/scottyeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottyeck/subscriptions","organizations_url":"https://api.github.com/users/scottyeck/orgs","repos_url":"https://api.github.com/users/scottyeck/repos","events_url":"https://api.github.com/users/scottyeck/events{/privacy}","received_events_url":"https://api.github.com/users/scottyeck/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-05-18T12:21:26Z","updated_at":"2017-05-18T14:42:28Z","closed_at":null,"body":"Current version: (latest canary at time of writing)\r\n`1.0.0-alpha15-alpha.7211d781`\r\n\r\nWhen I run `gatsby build`, the preloader script prefixes do not match up with the scripts in `/public` - instead, they're just `/x` where `x` is just a single character. Top of `index.html` reads as follows:\r\n\r\n```html\r\n<head>\r\n    <link rel=\"preload\" href=\"/p\" as=\"script\" />\r\n    <link rel=\"preload\" href=\"/p\" as=\"script\" />\r\n    <link rel=\"preload\" href=\"/l\" as=\"script\" />\r\n    <link rel=\"preload\" href=\"/a\" as=\"script\" />\r\n    <link rel=\"preload\" href=\"/c\" as=\"script\" />\r\n```\r\n\r\nAll the while, the assets output to public read as follows:\r\n\r\n```\r\napp-58579413a27c41b952ee.js\r\nchunk-manifest.json\r\ncommons-97a5dea1afd5fc29d501.js\r\nlayout-component---index-249467b39ee2266b325d.js\r\npage-component---src-pages-404-jsx-e1d6c2e05b728281adb2.js\r\npage-component---src-pages-about-jsx-ad9f47b75e2e15931b48.js\r\npage-component---src-pages-app-js-1c46b1e6c9cb8804f709.js\r\n```\r\n\r\n(etc.)\r\n\r\nLooks like the preloader-link generating mechanism in `static-entry.js` is just slicing off the first character via the `fetchKey` that gets passed to `_.get`.\r\n\r\n```js\r\nconst fetchKey = `assetsByChunkName[${script}][0]`\r\n```\r\n\r\nThis gets resolved when I remove the 0-index at the end of the `fetchKey` which makes sense. Will PR, though I wanted to make sure that this was outlined. In the event that this is a use-case specific to us, I'd like to know why.\r\n\r\n_(Edit - forgot to actually include the example output)_"},"comment":{"url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/comments/302425022","html_url":"https://github.com/gatsbyjs/gatsby/issues/988#issuecomment-302425022","issue_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/988","id":302425022,"user":{"login":"KyleAMathews","id":71047,"avatar_url":"https://avatars0.githubusercontent.com/u/71047?v=3","gravatar_id":"","url":"https://api.github.com/users/KyleAMathews","html_url":"https://github.com/KyleAMathews","followers_url":"https://api.github.com/users/KyleAMathews/followers","following_url":"https://api.github.com/users/KyleAMathews/following{/other_user}","gists_url":"https://api.github.com/users/KyleAMathews/gists{/gist_id}","starred_url":"https://api.github.com/users/KyleAMathews/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KyleAMathews/subscriptions","organizations_url":"https://api.github.com/users/KyleAMathews/orgs","repos_url":"https://api.github.com/users/KyleAMathews/repos","events_url":"https://api.github.com/users/KyleAMathews/events{/privacy}","received_events_url":"https://api.github.com/users/KyleAMathews/received_events","type":"User","site_admin":false},"created_at":"2017-05-18T14:42:27Z","updated_at":"2017-05-18T14:42:27Z","body":"Ooo that would do it. Yeah just add a check if its an array and that should\ndo it.\n\nOn Thu, May 18, 2017, 4:12 PM Scotty Eckenthal <notifications@github.com>\nwrote:\n\n> @KyleAMathews <https://github.com/kyleamathews> We disable sourcemaps in\n> production. When I enable them, this goes away. Perhaps the check should be\n> conditional?\n>\n> —\n> You are receiving this because you were mentioned.\n>\n>\n> Reply to this email directly, view it on GitHub\n> <https://github.com/gatsbyjs/gatsby/issues/988#issuecomment-302415685>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AAEVh8v7mnyveiAEFstGe0iWhk7GcytKks5r7FHBgaJpZM4NfI_1>\n> .\n>\n"}}
{"actor":{"display_login":"KyleAMathews"}}