{"action":"created","issue":{"url":"https://api.github.com/repos/webpack/webpack/issues/8538","repository_url":"https://api.github.com/repos/webpack/webpack","labels_url":"https://api.github.com/repos/webpack/webpack/issues/8538/labels{/name}","comments_url":"https://api.github.com/repos/webpack/webpack/issues/8538/comments","events_url":"https://api.github.com/repos/webpack/webpack/issues/8538/events","html_url":"https://github.com/webpack/webpack/issues/8538","id":393583057,"node_id":"MDU6SXNzdWUzOTM1ODMwNTc=","number":8538,"title":"Module not found: TypeError: Cannot read property 'request' of null","user":{"login":"codejamninja","id":6234038,"node_id":"MDQ6VXNlcjYyMzQwMzg=","avatar_url":"https://avatars1.githubusercontent.com/u/6234038?v=4","gravatar_id":"","url":"https://api.github.com/users/codejamninja","html_url":"https://github.com/codejamninja","followers_url":"https://api.github.com/users/codejamninja/followers","following_url":"https://api.github.com/users/codejamninja/following{/other_user}","gists_url":"https://api.github.com/users/codejamninja/gists{/gist_id}","starred_url":"https://api.github.com/users/codejamninja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codejamninja/subscriptions","organizations_url":"https://api.github.com/users/codejamninja/orgs","repos_url":"https://api.github.com/users/codejamninja/repos","events_url":"https://api.github.com/users/codejamninja/events{/privacy}","received_events_url":"https://api.github.com/users/codejamninja/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-12-21T20:32:29Z","updated_at":"2018-12-22T11:57:30Z","closed_at":null,"author_association":"NONE","body":"# Bug report\r\n\r\nI get the following error when running the newest version of webpack `v4.28.1`.\r\n\r\n```\r\nModule not found: TypeError: Cannot read property 'request' of null\r\n```\r\n\r\nIt happens whenever I try and import a dependency that only works on Node.JS that I've set to an empty object (for example `fs`).\r\n\r\nHere is my webpack externals config.\r\n\r\n```js\r\nwebpackConfig.externals = {\r\n  child_process: '{}',\r\n  deasync: '{}',\r\n  fs: '{}',\r\n  winston: '{}'\r\n}\r\n```\r\n\r\nPlease note that this works fine on webpack `v4.27.1`.\r\n\r\nHere is the full stack trace.\r\n\r\n```\r\nERROR in ./node_modules/@reactant/core/lib/log/winston.js\r\nModule not found: TypeError: Cannot read property 'request' of null\r\n @ ./node_modules/@reactant/core/lib/log/winston.js 17:15-33\r\n @ ./node_modules/@reactant/core/lib/log/index.js\r\n @ ./node_modules/@reactant/core/lib/index.js\r\n @ /Users/codejamninja/Projects/reactant/packages/web-isomorphic/lib/hotDevClient.js\r\n @ multi ./web/client.js /Users/codejamninja/Projects/reactant/packages/web-isomorphic/lib/hotDevClient.js\r\n\r\nERROR in ./node_modules/fs-extra/lib/index.js\r\nModule not found: TypeError: Cannot read property 'request' of null\r\n @ ./node_modules/fs-extra/lib/index.js 23:11-24\r\n @ ./node_modules/@reactant/core/lib/log/winston.js\r\n @ ./node_modules/@reactant/core/lib/log/index.js\r\n @ ./node_modules/@reactant/core/lib/index.js\r\n @ /Users/codejamninja/Projects/reactant/packages/web-isomorphic/lib/hotDevClient.js\r\n @ multi ./web/client.js /Users/codejamninja/Projects/reactant/packages/web-isomorphic/lib/hotDevClient.js\r\n\r\nERROR in ./node_modules/fs-extra/lib/empty/index.js\r\nModule not found: TypeError: Cannot read property 'request' of null\r\n @ ./node_modules/fs-extra/lib/empty/index.js 4:11-24\r\n @ ./node_modules/fs-extra/lib/index.js\r\n @ ./node_modules/@reactant/core/lib/log/winston.js\r\n @ ./node_modules/@reactant/core/lib/log/index.js\r\n @ ./node_modules/@reactant/core/lib/index.js\r\n @ /Users/codejamninja/Projects/reactant/packages/web-isomorphic/lib/hotDevClient.js\r\n @ multi ./web/client.js /Users/codejamninja/Projects/reactant/packages/web-isomorphic/lib/hotDevClient.js\r\n\r\nERROR in /Users/codejamninja/Projects/reactant/packages/cli/node_modules/js-info/lib/getOS/index.js\r\nModule not found: TypeError: Cannot read property 'request' of null\r\n @ /Users/codejamninja/Projects/reactant/packages/cli/node_modules/js-info/lib/getOS/index.js 90:21-45\r\n @ /Users/codejamninja/Projects/reactant/packages/cli/node_modules/js-info/lib/os.js\r\n @ /Users/codejamninja/Projects/reactant/packages/cli/node_modules/js-info/lib/index.js\r\n @ ./node_modules/@reactant/core/lib/log/index.js\r\n @ ./node_modules/@reactant/core/lib/index.js\r\n @ /Users/codejamninja/Projects/reactant/packages/web-isomorphic/lib/hotDevClient.js\r\n @ multi ./web/client.js /Users/codejamninja/Projects/reactant/packages/web-isomorphic/lib/hotDevClient.js\r\n\r\nERROR in /Users/codejamninja/Projects/reactant/packages/cli/node_modules/js-info/lib/getOS/index.js\r\nModule not found: TypeError: Cannot read property 'request' of null\r\n @ /Users/codejamninja/Projects/reactant/packages/cli/node_modules/js-info/lib/getOS/index.js 89:16-34\r\n @ /Users/codejamninja/Projects/reactant/packages/cli/node_modules/js-info/lib/os.js\r\n @ /Users/codejamninja/Projects/reactant/packages/cli/node_modules/js-info/lib/index.js\r\n @ ./node_modules/@reactant/core/lib/log/index.js\r\n @ ./node_modules/@reactant/core/lib/index.js\r\n @ /Users/codejamninja/Projects/reactant/packages/web-isomorphic/lib/hotDevClient.js\r\n @ multi ./web/client.js /Users/codejamninja/Projects/reactant/packages/web-isomorphic/lib/hotDevClient.js\r\n\r\nERROR in ./node_modules/graceful-fs/graceful-fs.js\r\nModule not found: TypeError: Cannot read property 'request' of null\r\n @ ./node_modules/graceful-fs/graceful-fs.js 1:9-22\r\n @ ./node_modules/fs-extra/lib/move-sync/index.js\r\n @ ./node_modules/fs-extra/lib/index.js\r\n @ ./node_modules/@reactant/core/lib/log/winston.js\r\n @ ./node_modules/@reactant/core/lib/log/index.js\r\n @ ./node_modules/@reactant/core/lib/index.js\r\n @ /Users/codejamninja/Projects/reactant/packages/web-isomorphic/lib/hotDevClient.js\r\n @ multi ./web/client.js /Users/codejamninja/Projects/reactant/packages/web-isomorphic/lib/hotDevClient.js\r\n\r\nERROR in ./node_modules/jsonfile/index.js\r\nModule not found: TypeError: Cannot read property 'request' of null\r\n @ ./node_modules/jsonfile/index.js 5:8-21\r\n @ ./node_modules/fs-extra/lib/json/jsonfile.js\r\n @ ./node_modules/fs-extra/lib/json/index.js\r\n @ ./node_modules/fs-extra/lib/index.js\r\n @ ./node_modules/@reactant/core/lib/log/winston.js\r\n @ ./node_modules/@reactant/core/lib/log/index.js\r\n @ ./node_modules/@reactant/core/lib/index.js\r\n @ /Users/codejamninja/Projects/reactant/packages/web-isomorphic/lib/hotDevClient.js\r\n @ multi ./web/client.js /Users/codejamninja/Projects/reactant/packages/web-isomorphic/lib/hotDevClient.js\r\n```\r\n\r\nInstead of throwing an error, it should simply require the module as an empty object.\r\nBecause the error is happening inside of webpack, the stack trace does not tell me what is going wrong. I've searched all over for this supposed 'test' property. I am not using a property called test anywhere in my code.\r\n\r\nThis also fails with other node-specific npm modules, such as `winston` and `deasync`.\r\n\r\n**Other relevant information:**\r\nwebpack version:  \r\nNode.js version: v8.14.0\r\nAlso tested on Node.js version: v10.14.\r\nOperating System: Ubuntu 18.10\r\n"},"comment":{"url":"https://api.github.com/repos/webpack/webpack/issues/comments/449565166","html_url":"https://github.com/webpack/webpack/issues/8538#issuecomment-449565166","issue_url":"https://api.github.com/repos/webpack/webpack/issues/8538","id":449565166,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0OTU2NTE2Ng==","user":{"login":"pleunv","id":182021,"node_id":"MDQ6VXNlcjE4MjAyMQ==","avatar_url":"https://avatars3.githubusercontent.com/u/182021?v=4","gravatar_id":"","url":"https://api.github.com/users/pleunv","html_url":"https://github.com/pleunv","followers_url":"https://api.github.com/users/pleunv/followers","following_url":"https://api.github.com/users/pleunv/following{/other_user}","gists_url":"https://api.github.com/users/pleunv/gists{/gist_id}","starred_url":"https://api.github.com/users/pleunv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pleunv/subscriptions","organizations_url":"https://api.github.com/users/pleunv/orgs","repos_url":"https://api.github.com/users/pleunv/repos","events_url":"https://api.github.com/users/pleunv/events{/privacy}","received_events_url":"https://api.github.com/users/pleunv/received_events","type":"User","site_admin":false},"created_at":"2018-12-22T11:57:30Z","updated_at":"2018-12-22T11:57:30Z","author_association":"NONE","body":"Just to confirm I'm running into the same, also with `moment` and the above `IgnorePlugin` setup."}}
{"actor":{"display_login":"pleunv"}}