{"action":"created","issue":{"url":"https://api.github.com/repos/zeit/next.js/issues/247","repository_url":"https://api.github.com/repos/zeit/next.js","labels_url":"https://api.github.com/repos/zeit/next.js/issues/247/labels{/name}","comments_url":"https://api.github.com/repos/zeit/next.js/issues/247/comments","events_url":"https://api.github.com/repos/zeit/next.js/issues/247/events","html_url":"https://github.com/zeit/next.js/issues/247","id":188937840,"number":247,"title":"Error with khan/aphrodite for CSS when manually reload","user":{"login":"alexrqs","id":1099589,"avatar_url":"https://avatars.githubusercontent.com/u/1099589?v=3","gravatar_id":"","url":"https://api.github.com/users/alexrqs","html_url":"https://github.com/alexrqs","followers_url":"https://api.github.com/users/alexrqs/followers","following_url":"https://api.github.com/users/alexrqs/following{/other_user}","gists_url":"https://api.github.com/users/alexrqs/gists{/gist_id}","starred_url":"https://api.github.com/users/alexrqs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexrqs/subscriptions","organizations_url":"https://api.github.com/users/alexrqs/orgs","repos_url":"https://api.github.com/users/alexrqs/repos","events_url":"https://api.github.com/users/alexrqs/events{/privacy}","received_events_url":"https://api.github.com/users/alexrqs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-12T22:12:05Z","updated_at":"2016-11-14T21:52:42Z","closed_at":null,"body":"```jsx\r\n// pages/index.js\r\nimport React from 'react'\r\nimport { StyleSheet, css } from 'aphrodite'\r\n\r\nconst styles = StyleSheet.create({ h1: { color: 'crimson' } })\r\n\r\nconst header = () => <h1 className={css(styles.h1)}>Hola</h1>\r\n\r\nexport default header;\r\n\r\n```\r\n\r\nIf the document is already open when you apply `css(styles.h1)` it takes the chages and you see the red text, but if you manually reload the browser or the application is just starting you get a `500 | Internal Server Error.`\r\n\r\nand the console will give you \r\n```sh\r\nError: Cannot automatically buffer without a document\r\n    at injectGeneratedCSSOnce (/nextApp/node_modules/aphrodite/lib/inject.js:138:23)\r\n    at injectStyleOnce (/nextApp/node_modules/aphrodite/lib/inject.js:156:9)\r\n    at injectAndGetClassName (/nextApp/node_modules/aphrodite/lib/inject.js:232:5)\r\n    at css (/nextApp/node_modules/aphrodite/lib/exports.js:133:54)\r\n    at header (/nextApp/.next/dist/pages/index.js:22:37)\r\n    at /nextApp/node_modules/react/lib/ReactCompositeComponent.js:305:16\r\n    at measureLifeCyclePerf (/nextApp/node_modules/react/lib/ReactCompositeComponent.js:74:12)\r\n    at ReactCompositeComponentWrapper._constructComponentWithoutOwner (/nextApp/node_modules/react/lib/ReactCompositeComponent.js:304:14)\r\n    at ReactCompositeComponentWrapper._constructComponent (/nextApp/node_modules/react/lib/ReactCompositeComponent.js:279:21)\r\n    at ReactCompositeComponentWrapper.mountComponent (/nextApp/node_modules/react/lib/ReactCompositeComponent.js:187:21)\r\n```\r\n\r\nI get the `import style from 'next/css'` but I already have another project with aphrodite modules that I'd like to reuse."},"comment":{"url":"https://api.github.com/repos/zeit/next.js/issues/comments/260474722","html_url":"https://github.com/zeit/next.js/issues/247#issuecomment-260474722","issue_url":"https://api.github.com/repos/zeit/next.js/issues/247","id":260474722,"user":{"login":"impronunciable","id":165799,"avatar_url":"https://avatars.githubusercontent.com/u/165799?v=3","gravatar_id":"","url":"https://api.github.com/users/impronunciable","html_url":"https://github.com/impronunciable","followers_url":"https://api.github.com/users/impronunciable/followers","following_url":"https://api.github.com/users/impronunciable/following{/other_user}","gists_url":"https://api.github.com/users/impronunciable/gists{/gist_id}","starred_url":"https://api.github.com/users/impronunciable/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/impronunciable/subscriptions","organizations_url":"https://api.github.com/users/impronunciable/orgs","repos_url":"https://api.github.com/users/impronunciable/repos","events_url":"https://api.github.com/users/impronunciable/events{/privacy}","received_events_url":"https://api.github.com/users/impronunciable/received_events","type":"User","site_admin":false},"created_at":"2016-11-14T21:52:42Z","updated_at":"2016-11-14T21:52:42Z","body":"@alexrqs your snippet with `next/css` looks like this:\r\n\r\n```\r\n\r\n// pages/index.js\r\nimport React from 'react'\r\nimport css from 'next/css'\r\n\r\nconst styles = { h1: { color: 'crimson' } }\r\n\r\nconst header = () => <h1 className={css(styles.h1)}>Hola</h1>\r\n\r\nexport default header;\r\n```"}}
{"actor":{"display_login":"impronunciable"}}