{"action":"created","issue":{"url":"https://api.github.com/repos/webpack/mocha-loader/issues/43","repository_url":"https://api.github.com/repos/webpack/mocha-loader","labels_url":"https://api.github.com/repos/webpack/mocha-loader/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/webpack/mocha-loader/issues/43/comments","events_url":"https://api.github.com/repos/webpack/mocha-loader/issues/43/events","html_url":"https://github.com/webpack/mocha-loader/issues/43","id":173214520,"number":43,"title":"Strange failure","user":{"login":"miguel-guedes","id":4202911,"avatar_url":"https://avatars.githubusercontent.com/u/4202911?v=3","gravatar_id":"","url":"https://api.github.com/users/miguel-guedes","html_url":"https://github.com/miguel-guedes","followers_url":"https://api.github.com/users/miguel-guedes/followers","following_url":"https://api.github.com/users/miguel-guedes/following{/other_user}","gists_url":"https://api.github.com/users/miguel-guedes/gists{/gist_id}","starred_url":"https://api.github.com/users/miguel-guedes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguel-guedes/subscriptions","organizations_url":"https://api.github.com/users/miguel-guedes/orgs","repos_url":"https://api.github.com/users/miguel-guedes/repos","events_url":"https://api.github.com/users/miguel-guedes/events{/privacy}","received_events_url":"https://api.github.com/users/miguel-guedes/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/webpack/mocha-loader/labels/1.0.0","name":"1.0.0","color":"c5def5"},{"url":"https://api.github.com/repos/webpack/mocha-loader/labels/question","name":"question","color":"006b75"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-25T14:13:22Z","updated_at":"2016-09-26T11:07:51Z","closed_at":null,"body":"I'm getting a very strange failure whenever I attempt to run tests in node\r\nenvironment.  The tests run fine in the browser though (using a slightly different configuration).  \r\n\r\nI created a `test` script in `package.json` like so:\r\n`\"test\": \"mocha-webpack --colors --webpack-config webpack.config-test.js \\\"test/start.js\\\"\"`\r\n\r\n`webpack.config-test.js` contains the following:\r\n\r\n```javascript\r\nvar webpack = require(\"webpack\");\r\nvar nodeExternals = require(\"webpack-node-externals\");\r\n\r\nmodule.exports = {\r\n  target: \"node\",\r\n  externals: [nodeExternals()],\r\n  module: {\r\n    preLoaders: [\r\n      { test: /\\.js$/, exclude: /node_modules/, loader: \"eslint\" }\r\n    ],\r\n    loaders: [\r\n      {\r\n        test: /.js$/,\r\n        loader: \"babel\",\r\n        exclude: /node_modules/,\r\n        query: {\r\n          presets: [\"es2015\"],\r\n          cacheDirectory: true\r\n        }\r\n      },\r\n      { test: /\\.json$/, loader: \"json\" },\r\n      { test: /\\.css$/, loader: \"css\" },\r\n      { test: /\\.html$/, loader: \"dom!html\" },\r\n    ]\r\n  },\r\n  plugins: [\r\n    new webpack.DefinePlugin({PRODUCTION: false,\r\n                              BROWSER: false}),\r\n  ],\r\n  devtool: \"source-map\"\r\n};\r\n```\r\nWhenever I run `npm test`, the following very strange output is produced:\r\n\r\n```sh\r\n$ npm test\r\n> html-highlighter@0.1.3 test /home/miguelg/work/html-highlighter\r\n> mocha-webpack --colors --webpack-config webpack.config-test.js \"test/start.js\"\r\n\r\n\r\nWARNING in ./~/mocha-loader/EnhancedMocha.js\r\nCritical dependencies:\r\n29:24-37 the request of a dependency is an expression\r\n @ ./~/mocha-loader/EnhancedMocha.js 29:24-37\r\n\r\nWARNING in ./~/mocha-loader/README.md\r\nModule parse failed: /home/miguelg/work/html-highlighter/node_modules/mocha-loader/README.md Unexpected character '#' (1:0)\r\nYou may need an appropriate loader to handle this file type.\r\nSyntaxError: Unexpected character '#' (1:0)\r\n    at Parser.pp$4.raise (/home/miguelg/work/html-highlighter/node_modules/webpack/node_modules/acorn/dist/acorn.js:2221:15)\r\n    at Parser.pp$7.getTokenFromCode (/home/miguelg/work/html-highlighter/node_modules/webpack/node_modules/acorn/dist/acorn.js:2756:10)\r\n    at Parser.pp$7.readToken (/home/miguelg/work/html-highlighter/node_modules/webpack/node_modules/acorn/dist/acorn.js:2477:17)\r\n    at Parser.pp$7.nextToken (/home/miguelg/work/html-highlighter/node_modules/webpack/node_modules/acorn/dist/acorn.js:2468:15)\r\n    at Parser.parse (/home/miguelg/work/html-highlighter/node_modules/webpack/node_modules/acorn/dist/acorn.js:515:10)\r\n    at Object.parse (/home/miguelg/work/html-highlighter/node_modules/webpack/node_modules/acorn/dist/acorn.js:3098:39)\r\n    at Parser.parse (/home/miguelg/work/html-highlighter/node_modules/webpack/lib/Parser.js:902:15)\r\n    at DependenciesBlock.<anonymous> (/home/miguelg/work/html-highlighter/node_modules/webpack/lib/NormalModule.js:104:16)\r\n    at DependenciesBlock.onModuleBuild (/home/miguelg/work/html-highlighter/node_modules/webpack-core/lib/NormalModuleMixin.js:310:10)\r\n    at nextLoader (/home/miguelg/work/html-highlighter/node_modules/webpack-core/lib/NormalModuleMixin.js:275:25)\r\n    at /home/miguelg/work/html-highlighter/node_modules/webpack-core/lib/NormalModuleMixin.js:259:5\r\n    at Storage.finished (/home/miguelg/work/html-highlighter/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:38:16)\r\n    at /home/miguelg/work/html-highlighter/node_modules/graceful-fs/graceful-fs.js:78:16\r\n    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:404:3)\r\n @ ./~/mocha-loader ^\\.\\/.*$\r\n\r\n\r\n\r\n\r\n  0 passing (0ms)\r\n\r\n  1) fix test errors\r\n\r\n  0 passing (4ms)\r\n  1 failing\r\n\r\n  1)  fix test errors:\r\n     Error: Cannot find module '!!/home/miguelg/work/html-highlighter/node_modules/babel-loader/index.js?{\"presets\":[\"es2015\"],\"cacheDirectory\":true}!/home/miguelg/work/html-highlighter/node_modules/eslint-loader/index.js!/home/miguelg/work/html-highlighter/src/htmlhighlighter_test.js'.\r\n      at .tmp/mocha-webpack/start.js:182:42\r\n      at webpackContextResolve (.tmp/mocha-webpack/start.js:182:90)\r\n      at webpackContext (.tmp/mocha-webpack/start.js:179:30)\r\n      at Mocha.EnhancedMocha.loadFiles (.tmp/mocha-webpack/start.js:119:48)\r\n      at Mocha.EnhancedMocha.watch (.tmp/mocha-webpack/start.js:139:8)\r\n      at Object.<anonymous> (.tmp/mocha-webpack/start.js:85:8)\r\n      at __webpack_require__ (.tmp/mocha-webpack/start.js:20:30)\r\n      at webpackContext (.tmp/mocha-webpack/start.js:65:10)\r\n      at Array.forEach (native)\r\n      at Object.map../htmlhighlighter_test.js (.tmp/mocha-webpack/start.js:55:17)\r\n      at __webpack_require__ (.tmp/mocha-webpack/start.js:20:30)\r\n      at .tmp/mocha-webpack/start.js:40:18\r\n      at Object.<anonymous> (.tmp/mocha-webpack/start.js:43:10)\r\n      at require (internal/module.js:20:19)\r\n      at Array.forEach (native)\r\n      at node_modules/mocha-webpack/lib/cli/runner.js:59:11\r\n      at Compiler.<anonymous> (node_modules/mocha-webpack/lib/webpack/createCompiler.js:76:7)\r\n      at Compiler.applyPlugins (node_modules/tapable/lib/Tapable.js:26:37)\r\n      at Compiler.<anonymous> (node_modules/webpack/lib/Compiler.js:193:12)\r\n      at Compiler.emitRecords (node_modules/webpack/lib/Compiler.js:282:37)\r\n      at Compiler.<anonymous> (node_modules/webpack/lib/Compiler.js:187:11)\r\n      at node_modules/webpack/lib/Compiler.js:275:11\r\n      at Compiler.applyPluginsAsync (node_modules/tapable/lib/Tapable.js:60:69)\r\n      at Compiler.afterEmit (node_modules/webpack/lib/Compiler.js:272:8)\r\n      at Compiler.<anonymous> (node_modules/webpack/lib/Compiler.js:267:14)\r\n      at node_modules/async/lib/async.js:52:16\r\n      at done (node_modules/async/lib/async.js:246:17)\r\n      at node_modules/async/lib/async.js:44:16\r\n      at node_modules/graceful-fs/graceful-fs.js:43:10\r\n      at FSReqWrap.oncomplete (fs.js:82:15)\r\n\r\n\r\n\r\nnpm ERR! Test failed.  See above for more details.\r\n```\r\n\r\nI'm baffled.  Notice the warning on the `README.md` file and the wrong tests\r\nbeing run (\"fix test errors\").  The config is using the `webpack-node-externals` package.\r\n\r\nAny thoughts as to what is happening?"},"comment":{"url":"https://api.github.com/repos/webpack/mocha-loader/issues/comments/249541610","html_url":"https://github.com/webpack/mocha-loader/issues/43#issuecomment-249541610","issue_url":"https://api.github.com/repos/webpack/mocha-loader/issues/43","id":249541610,"user":{"login":"MrCheater","id":5055654,"avatar_url":"https://avatars.githubusercontent.com/u/5055654?v=3","gravatar_id":"","url":"https://api.github.com/users/MrCheater","html_url":"https://github.com/MrCheater","followers_url":"https://api.github.com/users/MrCheater/followers","following_url":"https://api.github.com/users/MrCheater/following{/other_user}","gists_url":"https://api.github.com/users/MrCheater/gists{/gist_id}","starred_url":"https://api.github.com/users/MrCheater/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrCheater/subscriptions","organizations_url":"https://api.github.com/users/MrCheater/orgs","repos_url":"https://api.github.com/users/MrCheater/repos","events_url":"https://api.github.com/users/MrCheater/events{/privacy}","received_events_url":"https://api.github.com/users/MrCheater/received_events","type":"User","site_admin":false},"created_at":"2016-09-26T11:07:51Z","updated_at":"2016-09-26T11:07:51Z","body":"I'm having the same problem."}}
{"actor":{"display_login":"MrCheater"}}