{"action":"opened","issue":{"url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/7401","repository_url":"https://api.github.com/repos/gatsbyjs/gatsby","labels_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/7401/labels{/name}","comments_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/7401/comments","events_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/7401/events","html_url":"https://github.com/gatsbyjs/gatsby/issues/7401","id":351461730,"node_id":"MDU6SXNzdWUzNTE0NjE3MzA=","number":7401,"title":"exports of gatsby-plugin-styled-components are different depending on whether it's a dependency or a devdependency","user":{"login":"eqyiel","id":3422442,"node_id":"MDQ6VXNlcjM0MjI0NDI=","avatar_url":"https://avatars2.githubusercontent.com/u/3422442?v=4","gravatar_id":"","url":"https://api.github.com/users/eqyiel","html_url":"https://github.com/eqyiel","followers_url":"https://api.github.com/users/eqyiel/followers","following_url":"https://api.github.com/users/eqyiel/following{/other_user}","gists_url":"https://api.github.com/users/eqyiel/gists{/gist_id}","starred_url":"https://api.github.com/users/eqyiel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eqyiel/subscriptions","organizations_url":"https://api.github.com/users/eqyiel/orgs","repos_url":"https://api.github.com/users/eqyiel/repos","events_url":"https://api.github.com/users/eqyiel/events{/privacy}","received_events_url":"https://api.github.com/users/eqyiel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-17T05:29:47Z","updated_at":"2018-08-17T05:29:47Z","closed_at":null,"author_association":"MEMBER","body":"<!--\r\n  To make it easier for us to help you — please follow the suggested format below.\r\n\r\n  Useful Links:\r\n  - Documentation: https://www.gatsbyjs.org/docs/\r\n  - How to File an Issue: https://www.gatsbyjs.org/docs/how-to-file-an-issue/\r\n\r\n  Before opening a new issue, please search existing issues https://github.com/gatsbyjs/gatsby/issues\r\n-->\r\n\r\n## Description\r\n\r\nThe contents of `node_modules/gatsby-plugin-styled-components/gatsby-ssr.js` are different (`exports.replaceRenderer` vs `exports.wrapRootElement`) depending on whether it's a `dependency` or a `devDependency`.  Is this expected behaviour that I didn't notice before, or is something incredibly weird going on?\r\n\r\nOn 8ea66b4:\r\n\r\n```\r\n~/sync/git/mango-chutney/mango-components/examples 8ea66b4...*\r\n❯ git log -1\r\ncommit 8ea66b4a347702df8f7adb3c25aec73665669fd1 (HEAD)\r\nAuthor: Ruben Maher <ruben@maher.fyi>\r\nDate:   Fri Aug 17 12:38:10 2018 +0930\r\n\r\n    Move gatsby plugins to devDependencies\r\n\r\n~/sync/git/mango-chutney/mango-components/examples 8ea66b4...*\r\n❯ yarn\r\nyarn install v1.8.0\r\n[1/4] 🔍  Resolving packages...\r\nsuccess Already up-to-date.\r\n✨  Done in 0.68s.\r\n\r\n~/sync/git/mango-chutney/mango-components/examples 8ea66b4...*\r\n❯ rg gatsby-plugin-styled-components < package.json\r\n    \"gatsby-plugin-styled-components\": \"^3.0.0-beta.3\",\r\n\r\n~/sync/git/mango-chutney/mango-components/examples 8ea66b4...*\r\n❯ rg gatsby-plugin-styled-components < yarn.lock\r\ngatsby-plugin-styled-components@^3.0.0-beta.3:\r\n  resolved \"https://registry.yarnpkg.com/gatsby-plugin-styled-components/-/gatsby-plugin-styled-components-3.0.0-beta.4.tgz#18198dcae1e0793f01814c53278b8b928b97b172\"\r\n\r\n~/sync/git/mango-chutney/mango-components/examples 8ea66b4...*\r\n❯ yarn run start\r\nyarn run v1.8.0\r\n$ gatsby develop\r\nsuccess open and validate gatsby-config — 0.020 s\r\n⠁\r\nYour plugins must export known APIs from their gatsby-ssr.js.\r\nThe following exports aren't APIs. Perhaps you made a typo or your plugin is outdated?\r\n\r\nSee https://www.gatsbyjs.org/docs/ssr-apis/ for the list of Gatsby SSR APIs\r\n\r\n- The plugin \"gatsby-plugin-styled-components@3.0.0-beta.4\" is exporting a variable named \"wrapRootElement\" which isn't an API.\r\nsuccess load plugins — 0.141 s\r\nsuccess onPreInit — 0.033 s\r\nsuccess delete html and css files from previous builds — 0.030 s\r\nsuccess initialize cache — 0.005 s\r\nsuccess copy gatsby files — 0.023 s\r\nsuccess onPreBootstrap — 0.000 s\r\nsuccess source and transform nodes — 0.011 s\r\nsuccess building schema — 0.092 s\r\nsuccess createPages — 0.001 s\r\nsuccess createPagesStatefully — 0.039 s\r\nsuccess onPreExtractQueries — 0.000 s\r\nsuccess update schema — 0.097 s\r\nsuccess extract queries from components — 0.097 s\r\nsuccess run graphql queries — 0.044 s — 14/14 340.39 queries/second\r\nsuccess write out page data — 0.004 s\r\nsuccess write out redirect data — 0.003 s\r\nsuccess onPostBootstrap — 0.001 s\r\n\r\ninfo bootstrap finished - 2.172 s\r\n\r\n✨  Done in 6.99s.\r\nyarn run start  8.84s user 0.82s system 132% cpu 7.308 total\r\n\r\n~/sync/git/mango-chutney/mango-components/examples 8ea66b4...* 7s\r\n❯ cat node_modules/gatsby-plugin-styled-components/gatsby-ssr.js                                                                                                                                                                                                                                                            \r\n\"use strict\";\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nvar _react = _interopRequireDefault(require(\"react\"));\r\n\r\nvar _styledComponents = require(\"styled-components\");\r\n\r\nvar _jsxFileName = \"/Users/mike/dev/gatsby/packages/gatsby-plugin-styled-components/src/gatsby-ssr.js\";\r\nvar sheet = new _styledComponents.ServerStyleSheet(); // eslint-disable-next-line react/prop-types,react/display-name\r\n\r\nexports.wrapRootElement = function (_ref) {\r\n  var element = _ref.element;\r\n  return _react.default.createElement(_styledComponents.StyleSheetManager, {\r\n    sheet: sheet.instance,\r\n    __source: {\r\n      fileName: _jsxFileName,\r\n      lineNumber: 8\r\n    },\r\n    __self: this\r\n  }, element);\r\n};\r\n\r\nexports.onRenderBody = function (_ref2) {\r\n  var setHeadComponents = _ref2.setHeadComponents;\r\n  setHeadComponents([sheet.getStyleElement()]);\r\n};\r\n\r\n```\r\n\r\nOn c5b6d79:\r\n```\r\n~/sync/git/mango-chutney/mango-components/examples 8ea66b4...*\r\n❯ git checkout origin/babel-instructions\r\nPrevious HEAD position was 8ea66b4 Move gatsby plugins to devDependencies\r\nHEAD is now at c5b6d79 Revert \"Move gatsby plugins to devDependencies\"\r\n\r\n~/sync/git/mango-chutney/mango-components/examples heads/babel-instructions*\r\n❯ git log -1\r\ncommit c5b6d79d162b2f63778df985c486dd6927fa5f8a (HEAD, origin/babel-instructions, babel-instructions)\r\nAuthor: Ruben Maher <ruben@maher.fyi>\r\nDate:   Fri Aug 17 14:34:30 2018 +0930\r\n\r\n    Revert \"Move gatsby plugins to devDependencies\"\r\n\r\n    This reverts commit 8ea66b4a347702df8f7adb3c25aec73665669fd1.\r\n\r\n    This is causing a weird problem with plugin resolution.  Leaving the revert\r\n    commit as a warning for anyone who wants to try this in the future.\r\n\r\n~/sync/git/mango-chutney/mango-components/examples heads/babel-instructions*\r\n❯ yarn\r\nyarn install v1.8.0\r\n[1/4] 🔍  Resolving packages...\r\n[2/4] 🚚  Fetching packages...\r\n[--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 0/1423(node:46150) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.\r\n[3/4] 🔗  Linking dependencies...\r\nwarning \" > babel-loader@8.0.0-beta.4\" has unmet peer dependency \"webpack@>=2\".\r\n[4/4] 📃  Building fresh packages...\r\n✨  Done in 4.28s.\r\nyarn  5.23s user 2.14s system 159% cpu 4.609 total\r\n\r\n~/sync/git/mango-chutney/mango-components/examples heads/babel-instructions*\r\n❯ rg gatsby-plugin-styled-components < package.json\r\n    \"gatsby-plugin-styled-components\": \"^3.0.0-beta.3\",\r\n\r\n~/sync/git/mango-chutney/mango-components/examples heads/babel-instructions*\r\n❯ rg gatsby-plugin-styled-components < yarn.lock\r\ngatsby-plugin-styled-components@^3.0.0-beta.3:\r\n  resolved \"https://registry.yarnpkg.com/gatsby-plugin-styled-components/-/gatsby-plugin-styled-components-3.0.0-beta.3.tgz#da93c5feb4c87cac39733de6366e0eb15b35feca\"\r\n\r\n~/sync/git/mango-chutney/mango-components/examples heads/babel-instructions*\r\n❯ cat node_modules/gatsby-plugin-styled-components/gatsby-ssr.js\r\n\"use strict\";\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nvar _react = _interopRequireDefault(require(\"react\"));\r\n\r\nvar _styledComponents = require(\"styled-components\");\r\n\r\nvar _server = require(\"react-dom/server\");\r\n\r\nvar _jsxFileName = \"/Users/kylemathews/programs/gatsby-v2/packages/gatsby-plugin-styled-components/src/gatsby-ssr.js\";\r\n\r\nexports.replaceRenderer = function (_ref) {\r\n  var bodyComponent = _ref.bodyComponent,\r\n      replaceBodyHTMLString = _ref.replaceBodyHTMLString,\r\n      setHeadComponents = _ref.setHeadComponents;\r\n  var sheet = new _styledComponents.ServerStyleSheet();\r\n\r\n  var app = _react.default.createElement(_styledComponents.StyleSheetManager, {\r\n    sheet: sheet.instance,\r\n    __source: {\r\n      fileName: _jsxFileName,\r\n      lineNumber: 13\r\n    },\r\n    __self: this\r\n  }, bodyComponent);\r\n\r\n  var body = (0, _server.renderToString)(app);\r\n  replaceBodyHTMLString(body);\r\n  setHeadComponents([sheet.getStyleElement()]);\r\n  return;\r\n};\r\n~/sync/git/mango-chutney/mango-components/examples heads/babel-instructions*\r\n❯ yarn run start\r\nyarn run v1.8.0\r\n$ gatsby develop\r\nsuccess open and validate gatsby-config — 0.022 s\r\nwarning replaceRenderer API found in these plugins:\r\nwarning gatsby-plugin-styled-components, default-site-plugin\r\nwarning This might be an error, see: https://www.gatsbyjs.org/docs/debugging-replace-renderer-api/\r\n\r\nwarning Duplicate replaceRenderer found, skipping gatsby-ssr.js for plugin: gatsby-plugin-styled-components\r\n\r\nsuccess load plugins — 0.124 s\r\nsuccess onPreInit — 0.036 s\r\nsuccess delete html and css files from previous builds — 0.032 s\r\ninfo One or more of your plugins have changed since the last time you ran Gatsby. As\r\na precaution, we're deleting your site's cache to ensure there's not any stale\r\ndata\r\nsuccess initialize cache — 0.012 s\r\nsuccess copy gatsby files — 0.021 s\r\nsuccess onPreBootstrap — 0.001 s\r\nsuccess source and transform nodes — 0.013 s\r\nsuccess building schema — 0.103 s\r\nsuccess createPages — 0.000 s\r\nsuccess createPagesStatefully — 0.036 s\r\nsuccess onPreExtractQueries — 0.001 s\r\nsuccess update schema — 0.056 s\r\nsuccess extract queries from components — 0.056 s\r\nsuccess run graphql queries — 0.042 s — 14/14 351.21 queries/second\r\nsuccess write out page data — 0.004 s\r\nsuccess write out redirect data — 0.002 s\r\nsuccess onPostBootstrap — 0.001 s\r\n\r\ninfo bootstrap finished - 2.122 s\r\n\r\n DONE  Compiled successfully in 5749ms                                                                                                              2:43:22 PM\r\n\r\n\r\nYou can now view examples in the browser.\r\n\r\n  http://localhost:8000/\r\n\r\nView GraphiQL, an in-browser IDE, to explore your site's data and schema\r\n\r\n  http://localhost:8000/___graphql\r\n\r\nNote that the development build is not optimized.\r\nTo create a production build, use gatsby build\r\n\r\nℹ ｢wdm｣:\r\nℹ ｢wdm｣: Compiled successfully.\r\n✨  Done in 12.57s.\r\nyarn run start  14.55s user 1.28s system 122% cpu 12.885 total\r\n\r\n~/sync/git/mango-chutney/mango-components/examples heads/babel-instructions* 13s\r\n❯\r\n```\r\n\r\n### Steps to reproduce\r\n\r\nYou can check out the tip of this branch to play along:\r\n\r\nhttps://github.com/mango-chutney/mango-components/pull/64#issuecomment-413760031\r\n\r\n### Expected result\r\n\r\nContents of `gatsby-plugin-styled-components` don't change.\r\n\r\n### Actual result\r\n\r\nContents `gatsby-plugin-styled-components` changed based on whether it's installed as a `dependency` or `devDependency`.\r\n\r\n### Environment\r\n\r\n```\r\n~/sync/git/mango-chutney/mango-components/examples heads/babel-instructions*\r\n❯ yarn run gatsby info --clipboard\r\nyarn run v1.8.0\r\n$ /Users/rkm/sync/git/mango-chutney/mango-components/examples/node_modules/.bin/gatsby info --clipboard\r\n\r\n  System:\r\n    OS: macOS Sierra 10.12.6\r\n    CPU: x64 Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz\r\n    Shell: 4.4.23 - /nix/store/q2wqq1k20v8kc3vckapqf5nws30brnni-bash-4.4-p23/bin/bash\r\n  Binaries:\r\n    Node: 10.5.0 - /nix/store/npnl4fpjgj678a6c9g6v99mdz62g70fx-nodejs-10.5.0/bin/node\r\n    Yarn: 1.8.0 - /nix/store/3zh4rvvlng6gs97qa068yqjfxlyzyr4z-yarn-1.8.0/bin/yarn\r\n    npm: 6.1.0 - /nix/store/npnl4fpjgj678a6c9g6v99mdz62g70fx-nodejs-10.5.0/bin/npm\r\n  Browsers:\r\n    Firefox: 61.0.2\r\n    Safari: 11.1.2\r\n  npmPackages:\r\n    gatsby: ^2.0.0-beta.93 => 2.0.0-beta.93\r\n    gatsby-cli: 2.0.0-beta.12 => 2.0.0-beta.12\r\n    gatsby-plugin-react-helmet: ^3.0.0-beta.4 => 3.0.0-beta.4\r\n    gatsby-plugin-styled-components: ^3.0.0-beta.3 => 3.0.0-beta.3\r\n\r\n✨  Done in 2.00s.\r\n```\r\n\r\n### File contents (if changed)\r\n\r\n`gatsby-config.js`: https://github.com/mango-chutney/mango-components/blob/8cfbbf9bf2c10b7ca53b417be18d47d229771376/examples/gatsby-config.js\r\n`package.json`: https://github.com/mango-chutney/mango-components/blob/8cfbbf9bf2c10b7ca53b417be18d47d229771376/examples/package.json\r\n`gatsby-node.js`: https://github.com/mango-chutney/mango-components/blob/8cfbbf9bf2c10b7ca53b417be18d47d229771376/examples/gatsby-node.js\r\n`gatsby-browser.js`: https://github.com/mango-chutney/mango-components/blob/8cfbbf9bf2c10b7ca53b417be18d47d229771376/examples/gatsby-browser.js\r\n`gatsby-ssr.js`: https://github.com/mango-chutney/mango-components/blob/8cfbbf9bf2c10b7ca53b417be18d47d229771376/examples/gatsby-ssr.js\r\n"}}
{"actor":{"display_login":"eqyiel"}}