{"action":"created","issue":{"url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/4089","repository_url":"https://api.github.com/repos/gatsbyjs/gatsby","labels_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/4089/labels{/name}","comments_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/4089/comments","events_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/4089/events","html_url":"https://github.com/gatsbyjs/gatsby/issues/4089","id":297903526,"number":4089,"title":"webpack alias does not work in develop mode...","user":{"login":"busticated","id":367674,"avatar_url":"https://avatars1.githubusercontent.com/u/367674?v=4","gravatar_id":"","url":"https://api.github.com/users/busticated","html_url":"https://github.com/busticated","followers_url":"https://api.github.com/users/busticated/followers","following_url":"https://api.github.com/users/busticated/following{/other_user}","gists_url":"https://api.github.com/users/busticated/gists{/gist_id}","starred_url":"https://api.github.com/users/busticated/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/busticated/subscriptions","organizations_url":"https://api.github.com/users/busticated/orgs","repos_url":"https://api.github.com/users/busticated/repos","events_url":"https://api.github.com/users/busticated/events{/privacy}","received_events_url":"https://api.github.com/users/busticated/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-02-16T20:01:24Z","updated_at":"2018-02-16T21:43:39Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"i'm trying to use a module which presents the same API across browser and server / node.js contexts but uses different implementations for each and i'm hitting a weird issue.\r\n\r\ni have a dependency that uses the browser field in package.json (info: https://github.com/defunctzombie/package-browser-field-spec) - when running `gatsby build` (or `develop`) it appears this setting is ignored (perhaps a webpack v1 issue).\r\n\r\nwhen i manually add a webpack alias via gatbsy's `modifyWebpackConfig` API, gatsby `build` works as expected but `develop` fails w/ `Error: WebpackError` while compiling html.js\r\n\r\nhere's `modifyWebpackConfig` in my `gatsby-node.js` file:\r\n\r\n    exports.modifyWebpackConfig = ({ config, stage }) => {\r\n        config.merge({\r\n            resolve: {\r\n                alias: {\r\n                    '@foo/bar': '@foo/baz/index.js'\r\n                }\r\n            }\r\n        });\r\n\r\n        return config;\r\n    };\r\n\r\nmy issue seems similar to: https://github.com/gatsbyjs/gatsby/issues/1654 but there's no obvious solution there.\r\n\r\n<details><summary>the full error shown during `develop`</summary>\r\n<p>\r\n\r\n```javascript\r\nerror There was an error compiling the html.js component for the development server.\r\n\r\nSee our docs page on debugging HTML builds for help https://goo.gl/yL9lND\r\n\r\n\r\n  Error: WebpackError\r\n  \r\n  - option-manager.js:180 \r\n    [my-site]/[babel-core]/lib/transformation/file/options/option-manager.js:180:17\r\n  \r\n  - Array.map\r\n  \r\n  - option-manager.js:158 Function.normalisePlugins\r\n    [my-site]/[babel-core]/lib/transformation/file/options/option-manager.js:158:20\r\n  \r\n  - option-manager.js:234 OptionManager.mergeOptions\r\n    [my-site]/[babel-core]/lib/transformation/file/options/option-manager.js:234:36\r\n  \r\n  - option-manager.js:368 OptionManager.init\r\n    [my-site]/[babel-core]/lib/transformation/file/options/option-manager.js:368:12\r\n  \r\n  - index.js:212 File.initOptions\r\n    [my-site]/[babel-core]/lib/transformation/file/index.js:212:65\r\n  \r\n  - index.js:135 new File\r\n    [my-site]/[babel-core]/lib/transformation/file/index.js:135:24\r\n  \r\n  - pipeline.js:46 Pipeline.transform\r\n    [my-site]/[babel-core]/lib/transformation/pipeline.js:46:16\r\n  \r\n  - index.js:46 transpile\r\n    [my-site]/[babel-loader]/lib/index.js:46:20\r\n  \r\n  - fs-cache.js:79 \r\n    [my-site]/[babel-loader]/lib/fs-cache.js:79:18\r\n  \r\n  - fs-cache.js:15 ReadFileContext.callback\r\n    [my-site]/[babel-loader]/lib/fs-cache.js:15:14\r\n  \r\n  - From previous event:\r\n  \r\n  - develop-html.js:40 _callee$\r\n    [my-site]/[gatsby]/dist/commands/develop-html.js:40:46\r\n  \r\n  - next_tick.js:131 _combinedTickCallback\r\n    internal/process/next_tick.js:131:7\r\n  \r\n  - next_tick.js:180 process._tickCallback\r\n    internal/process/next_tick.js:180:9\r\n```\r\n</p>\r\n</details>\r\n\r\n\r\n### Environment\r\n\r\nGatsby version: v1.9.175\r\nNode.js version: v8.9.4\r\nOperating System: v10.13.2 \r\n"},"comment":{"url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/comments/366366702","html_url":"https://github.com/gatsbyjs/gatsby/issues/4089#issuecomment-366366702","issue_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/4089","id":366366702,"user":{"login":"busticated","id":367674,"avatar_url":"https://avatars1.githubusercontent.com/u/367674?v=4","gravatar_id":"","url":"https://api.github.com/users/busticated","html_url":"https://github.com/busticated","followers_url":"https://api.github.com/users/busticated/followers","following_url":"https://api.github.com/users/busticated/following{/other_user}","gists_url":"https://api.github.com/users/busticated/gists{/gist_id}","starred_url":"https://api.github.com/users/busticated/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/busticated/subscriptions","organizations_url":"https://api.github.com/users/busticated/orgs","repos_url":"https://api.github.com/users/busticated/repos","events_url":"https://api.github.com/users/busticated/events{/privacy}","received_events_url":"https://api.github.com/users/busticated/received_events","type":"User","site_admin":false},"created_at":"2018-02-16T21:43:39Z","updated_at":"2018-02-16T21:43:39Z","author_association":"CONTRIBUTOR","body":"> I still unsure sure why you think the problem is related to that the error doesn't indicate anything other than an issue compiling a file\r\n\r\nwell, the error is `WebpackError`, it only fails when running `gatsby develop`, and i'm only adjusting the `alias` setting so 🤷‍♂️ . perhaps the issue title could be refined given our findings (happy to do that if you have suggestions).\r\n\r\nin the meantime, any tips on further debugging would be very much appreciated :pray: - thanks again for the help :+1:"}}
{"actor":{"display_login":"busticated"}}