{"action":"created","issue":{"url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/17197","repository_url":"https://api.github.com/repos/gatsbyjs/gatsby","labels_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/17197/labels{/name}","comments_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/17197/comments","events_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/17197/events","html_url":"https://github.com/gatsbyjs/gatsby/issues/17197","id":487123564,"node_id":"MDU6SXNzdWU0ODcxMjM1NjQ=","number":17197,"title":"Gatsby build error \"document is not defined\" only on Netlify","user":{"login":"notbrian","id":9014119,"node_id":"MDQ6VXNlcjkwMTQxMTk=","avatar_url":"https://avatars3.githubusercontent.com/u/9014119?v=4","gravatar_id":"","url":"https://api.github.com/users/notbrian","html_url":"https://github.com/notbrian","followers_url":"https://api.github.com/users/notbrian/followers","following_url":"https://api.github.com/users/notbrian/following{/other_user}","gists_url":"https://api.github.com/users/notbrian/gists{/gist_id}","starred_url":"https://api.github.com/users/notbrian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/notbrian/subscriptions","organizations_url":"https://api.github.com/users/notbrian/orgs","repos_url":"https://api.github.com/users/notbrian/repos","events_url":"https://api.github.com/users/notbrian/events{/privacy}","received_events_url":"https://api.github.com/users/notbrian/received_events","type":"User","site_admin":false},"labels":[{"id":214544677,"node_id":"MDU6TGFiZWwyMTQ1NDQ2Nzc=","url":"https://api.github.com/repos/gatsbyjs/gatsby/labels/type:%20question%20or%20discussion","name":"type: question or discussion","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2019-08-29T18:57:57Z","updated_at":"2019-09-05T09:17:23Z","closed_at":null,"author_association":"NONE","body":"## Summary\r\nI'm getting a `document is not defined` build error on my 404 page when I build on Netlify but the build runs successfully locally. I'm not referencing any document or window object in my page either.\r\n\r\n## Relevant information\r\n\r\nThis is the error from the Netlify log \r\n```\r\n2:20:59 PM: success Generating image thumbnails — 850/850 - 162.737 s\r\n2:21:07 PM: error #95313 ReferenceError: document is not defined\r\n2:21:07 PM: Building static HTML failed for path \"/404/\"\r\n2:21:07 PM: See our docs page for more info on this error: https://gatsby.dev/debug-html\r\n2:21:07 PM: \r\n2:21:07 PM:   ReferenceError: document is not defined\r\n2:21:07 PM:   \r\n2:21:07 PM:   - render-page.js:21018 Object\r\n2:21:07 PM:     /opt/build/repo/public/render-page.js:21018:21\r\n2:21:07 PM:   \r\n2:21:07 PM:   - react-dom-server.node.production.min.js:26 ya\r\n2:21:07 PM:     [repo]/[react-dom]/cjs/react-dom-server.node.production.min.js:26:264\r\n2:21:07 PM:   \r\n2:21:07 PM:   - react-dom-server.node.production.min.js:29 Object.useState\r\n2:21:07 PM:     [repo]/[react-dom]/cjs/react-dom-server.node.production.min.js:29:82\r\n2:21:07 PM:   \r\n2:21:07 PM:   - react.production.min.js:23 useState\r\n2:21:07 PM:     [repo]/[react]/cjs/react.production.min.js:23:312\r\n2:21:07 PM:   \r\n2:21:07 PM:   - render-page.js:21017 ./node_modules/react-three-fiber/dist/index.js.Object\r\n2:21:07 PM:     /opt/build/repo/public/render-page.js:21017:76\r\n2:21:07 PM:   \r\n2:21:07 PM:   - react-dom-server.node.production.min.js:33 c\r\n2:21:07 PM:     [repo]/[react-dom]/cjs/react-dom-server.node.production.min.js:33:501\r\n2:21:07 PM:   \r\n2:21:07 PM:   - react-dom-server.node.production.min.js:36 Sa\r\n2:21:07 PM:     [repo]/[react-dom]/cjs/react-dom-server.node.production.min.js:36:1\r\n2:21:07 PM:   \r\n2:21:07 PM:   - react-dom-server.node.production.min.js:41 a.render\r\n2:21:07 PM:     [repo]/[react-dom]/cjs/react-dom-server.node.production.min.js:41:467\r\n2:21:07 PM:   \r\n2:21:07 PM:   - react-dom-server.node.production.min.js:41 a.read\r\n2:21:07 PM:     [repo]/[react-dom]/cjs/react-dom-server.node.production.min.js:41:58\r\n2:21:07 PM:   \r\n2:21:07 PM:   - react-dom-server.node.production.min.js:53 renderToString\r\n2:21:07 PM:     [repo]/[react-dom]/cjs/react-dom-server.node.production.min.js:53:83\r\n2:21:07 PM:   \r\n2:21:07 PM:   - render-page.js:563 Module../.cache/static-entry.js.__webpack_exports__.defau    lt\r\n2:21:07 PM:     /opt/build/repo/public/render-page.js:563:28\r\n2:21:07 PM:   \r\n2:21:07 PM:   - render-html.js:35 Promise\r\n2:21:07 PM:     [repo]/[gatsby]/dist/utils/worker/render-html.js:35:36\r\n2:21:07 PM:   \r\n2:21:07 PM:   - debuggability.js:313 Promise._execute\r\n2:21:07 PM:     [repo]/[bluebird]/js/release/debuggability.js:313:9\r\n2:21:07 PM:   \r\n2:21:07 PM:   - promise.js:488 Promise._resolveFromExecutor\r\n2:21:07 PM:     [repo]/[bluebird]/js/release/promise.js:488:18\r\n2:21:07 PM:   \r\n2:21:07 PM:   - promise.js:79 new Promise\r\n2:21:07 PM:     [repo]/[bluebird]/js/release/promise.js:79:10\r\n2:21:07 PM:   \r\n2:21:07 PM:   - render-html.js:31 Promise.map.path\r\n2:21:07 PM:     [repo]/[gatsby]/dist/utils/worker/render-html.js:31:37\r\n2:21:07 PM:   \r\n2:21:07 PM: \r\n2:21:07 PM: Skipping functions preparation step: no functions directory set`\r\n```\r\n\r\nAnd this is my 404 page\r\n```\r\nimport React from \"react\";\r\nimport styled from \"styled-components\";\r\nimport AniLink from \"gatsby-plugin-transition-link/AniLink\";\r\n\r\nconst Container = styled.div`\r\n  width: 100vw;\r\n  height: 100vh;\r\n  margin: 0;\r\n  padding: 0;\r\n  background: black;\r\n  display: flex;\r\n  flex-direction: column;\r\n  justify-content: center;\r\n  align-items: center;\r\n  z-index: 800;\r\n  color: white;\r\n`;\r\n\r\nconst Heading = styled.h1`\r\n  font-family: \"URWAccidalia\";\r\n  font-size: 50px;\r\n  color: white;\r\n  text-align: center;\r\n  z-index: 805;\r\n`;\r\n\r\nconst HomeButton = styled(AniLink)`\r\n  font-family: \"URWAccidalia\";\r\n  font-size: 30px;\r\n  color: white;\r\n  text-align: center;\r\n  margin-top: 50px;\r\n  z-index: 806;\r\n  background: none;\r\n  border: none;\r\n  text-decoration: none;\r\n  opacity: 1;\r\n`;\r\n\r\nconst ErrorPage = () => {\r\n  return (\r\n    <Container>\r\n      <Heading>Page Not Found</Heading>\r\n      <HomeButton fade to=\"/\">\r\n        Go Back to Home\r\n      </HomeButton>\r\n    </Container>\r\n  );\r\n};\r\n\r\nexport default ErrorPage;\r\n```\r\n\r\n\r\n### File contents (if changed)\r\n\r\n`gatsby-config.js`: N/A <!-- Please use a code block or just leave it as is if wasn't changed -->\r\n`package.json`: N/A <!-- Please use a code block or just leave it as is if wasn't changed -->\r\n`gatsby-node.js`: N/A <!-- Please use a code block or just leave it as is if wasn't changed -->\r\n`gatsby-browser.js`: N/A <!-- Please use a code block or just leave it as is if wasn't changed -->\r\n`gatsby-ssr.js`: N/A <!-- Please use a code block or just leave it as is if wasn't changed -->\r\n"},"comment":{"url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/comments/528277220","html_url":"https://github.com/gatsbyjs/gatsby/issues/17197#issuecomment-528277220","issue_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/17197","id":528277220,"node_id":"MDEyOklzc3VlQ29tbWVudDUyODI3NzIyMA==","user":{"login":"LekoArts","id":16143594,"node_id":"MDQ6VXNlcjE2MTQzNTk0","avatar_url":"https://avatars2.githubusercontent.com/u/16143594?v=4","gravatar_id":"","url":"https://api.github.com/users/LekoArts","html_url":"https://github.com/LekoArts","followers_url":"https://api.github.com/users/LekoArts/followers","following_url":"https://api.github.com/users/LekoArts/following{/other_user}","gists_url":"https://api.github.com/users/LekoArts/gists{/gist_id}","starred_url":"https://api.github.com/users/LekoArts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LekoArts/subscriptions","organizations_url":"https://api.github.com/users/LekoArts/orgs","repos_url":"https://api.github.com/users/LekoArts/repos","events_url":"https://api.github.com/users/LekoArts/events{/privacy}","received_events_url":"https://api.github.com/users/LekoArts/received_events","type":"User","site_admin":false},"created_at":"2019-09-05T09:17:23Z","updated_at":"2019-09-05T09:17:23Z","author_association":"CONTRIBUTOR","body":"For reference, here is also a working `react-three-fiber` / Canvas component: https://github.com/LekoArts/gatsby-themes/blob/master/www/src/components/3d-model.tsx"}}
{"actor":{"display_login":"LekoArts"}}