{"action":"created","issue":{"url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/6411","repository_url":"https://api.github.com/repos/gatsbyjs/gatsby","labels_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/6411/labels{/name}","comments_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/6411/comments","events_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/6411/events","html_url":"https://github.com/gatsbyjs/gatsby/issues/6411","id":340754646,"node_id":"MDU6SXNzdWUzNDA3NTQ2NDY=","number":6411,"title":"How do I get css modules working with Gatsby v2","user":{"login":"tsmith123","id":7639854,"node_id":"MDQ6VXNlcjc2Mzk4NTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/7639854?v=4","gravatar_id":"","url":"https://api.github.com/users/tsmith123","html_url":"https://github.com/tsmith123","followers_url":"https://api.github.com/users/tsmith123/followers","following_url":"https://api.github.com/users/tsmith123/following{/other_user}","gists_url":"https://api.github.com/users/tsmith123/gists{/gist_id}","starred_url":"https://api.github.com/users/tsmith123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsmith123/subscriptions","organizations_url":"https://api.github.com/users/tsmith123/orgs","repos_url":"https://api.github.com/users/tsmith123/repos","events_url":"https://api.github.com/users/tsmith123/events{/privacy}","received_events_url":"https://api.github.com/users/tsmith123/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2018-07-12T18:44:32Z","updated_at":"2018-07-12T21:54:00Z","closed_at":"2018-07-12T21:54:00Z","author_association":"CONTRIBUTOR","body":"I thought I would give v2 a try but I seem to be having issues getting css modules working. They worked fine with v1.\r\n\r\nI'm using `onCreateWebpackConfig` but there doesn't seem to be much documentation on this yet (understandably). Has anyone managed to get this working yet? \r\n\r\n```\r\nexports.onCreateWebpackConfig = ({\r\n  stage,\r\n  rules,\r\n  loaders,\r\n  plugins,\r\n  actions,\r\n}) => {\r\n  actions.setWebpackConfig({\r\n    module: {\r\n      rules: [\r\n        {\r\n          test: /\\.scss$/,\r\n          use: [\r\n            loaders.miniCssExtract(),\r\n            loaders.css({ importLoaders: 1 })\r\n            loaders.postcss(),\r\n            `sass-loader`,\r\n          ],\r\n        },\r\n      ],\r\n    },\r\n    plugins: [\r\n      plugins.define({\r\n        __DEVELOPMENT__: stage === `develop` || stage === `develop-html`,\r\n      }),\r\n    ],\r\n  })\r\n}\r\n```\r\nI’m using scss files.\r\n\r\nI'm getting errors like this during `gatsby develop`:\r\n\r\n> Module build failed (from ./node_modules/babel-loader/lib/index.js):\r\n> Error: Cannot use styleName attribute for style name 'block' without importing at least one stylesheet.\r\n\r\nAlso, do I still need to use `gatsby-plugin-react-css-modules`?"},"comment":{"url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/comments/404662802","html_url":"https://github.com/gatsbyjs/gatsby/issues/6411#issuecomment-404662802","issue_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/6411","id":404662802,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDY2MjgwMg==","user":{"login":"tsmith123","id":7639854,"node_id":"MDQ6VXNlcjc2Mzk4NTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/7639854?v=4","gravatar_id":"","url":"https://api.github.com/users/tsmith123","html_url":"https://github.com/tsmith123","followers_url":"https://api.github.com/users/tsmith123/followers","following_url":"https://api.github.com/users/tsmith123/following{/other_user}","gists_url":"https://api.github.com/users/tsmith123/gists{/gist_id}","starred_url":"https://api.github.com/users/tsmith123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsmith123/subscriptions","organizations_url":"https://api.github.com/users/tsmith123/orgs","repos_url":"https://api.github.com/users/tsmith123/repos","events_url":"https://api.github.com/users/tsmith123/events{/privacy}","received_events_url":"https://api.github.com/users/tsmith123/received_events","type":"User","site_admin":false},"created_at":"2018-07-12T21:54:00Z","updated_at":"2018-07-12T21:54:00Z","author_association":"CONTRIBUTOR","body":"@anantoghosh that looks to have sorted it. Thanks for the help."}}
{"actor":{"display_login":"tsmith123"}}