{"action":"created","issue":{"url":"https://api.github.com/repos/karma-runner/karma/issues/2452","repository_url":"https://api.github.com/repos/karma-runner/karma","labels_url":"https://api.github.com/repos/karma-runner/karma/issues/2452/labels{/name}","comments_url":"https://api.github.com/repos/karma-runner/karma/issues/2452/comments","events_url":"https://api.github.com/repos/karma-runner/karma/issues/2452/events","html_url":"https://github.com/karma-runner/karma/issues/2452","id":189053655,"number":2452,"title":"ERROR [preprocess]: Can not load \"webpack\"!","user":{"login":"wellyshen","id":21308003,"avatar_url":"https://avatars.githubusercontent.com/u/21308003?v=3","gravatar_id":"","url":"https://api.github.com/users/wellyshen","html_url":"https://github.com/wellyshen","followers_url":"https://api.github.com/users/wellyshen/followers","following_url":"https://api.github.com/users/wellyshen/following{/other_user}","gists_url":"https://api.github.com/users/wellyshen/gists{/gist_id}","starred_url":"https://api.github.com/users/wellyshen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wellyshen/subscriptions","organizations_url":"https://api.github.com/users/wellyshen/orgs","repos_url":"https://api.github.com/users/wellyshen/repos","events_url":"https://api.github.com/users/wellyshen/events{/privacy}","received_events_url":"https://api.github.com/users/wellyshen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-14T08:26:56Z","updated_at":"2016-11-16T23:01:34Z","closed_at":null,"body":"Hi Guys, I'am using the karma@1.3.0 with karma-webpack@1.8.0, currently I updating my webpack from 2.1.0-beta.25 to 2.1.0-beta.26, when I running `npm test` I encountered the following error, does anyone has the same issue?\r\n\r\n<img width=\"828\" alt=\"2016-11-14 4 20 41\" src=\"https://cloud.githubusercontent.com/assets/21308003/20257741/9f14b87a-aa86-11e6-8f45-94c7a7a8730f.png\">\r\n\r\nHere's my karma.config:\r\n```javascript\r\n'use strict'; // eslint-disable-line\r\n\r\nconst path = require('path');\r\nconst webpackConfig = require('../webpack/config.test.babel');\r\n\r\nmodule.exports = (config) => {\r\n  config.set({\r\n    browsers: ['PhantomJS'],\r\n\r\n    singleRun: true,\r\n\r\n    frameworks: ['mocha'],\r\n\r\n    files: ['./test-bundler.js'],\r\n\r\n    preprocessors: {\r\n      './test-bundler.js': ['webpack', 'sourcemap'],\r\n    },\r\n\r\n    reporters: ['mocha', 'coverage'],\r\n\r\n    webpack: webpackConfig,\r\n\r\n    // Make Webpack bundle generation quiet\r\n    webpackMiddleware: {\r\n      noInfo: true,\r\n      stats: 'errors-only',\r\n    },\r\n\r\n    // Set the format of reporter\r\n    coverageReporter: {\r\n      dir: path.join(process.cwd(), './coverage'),\r\n      reporters: [\r\n        { type: 'html', subdir: 'html' },\r\n        { type: 'lcov', subdir: 'lcov' },\r\n        { type: 'text-summary', subdir: '.', file: 'text-summary.txt' },\r\n      ],\r\n    },\r\n  });\r\n};\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/karma-runner/karma/issues/comments/261100899","html_url":"https://github.com/karma-runner/karma/issues/2452#issuecomment-261100899","issue_url":"https://api.github.com/repos/karma-runner/karma/issues/2452","id":261100899,"user":{"login":"Aktof","id":310165,"avatar_url":"https://avatars.githubusercontent.com/u/310165?v=3","gravatar_id":"","url":"https://api.github.com/users/Aktof","html_url":"https://github.com/Aktof","followers_url":"https://api.github.com/users/Aktof/followers","following_url":"https://api.github.com/users/Aktof/following{/other_user}","gists_url":"https://api.github.com/users/Aktof/gists{/gist_id}","starred_url":"https://api.github.com/users/Aktof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aktof/subscriptions","organizations_url":"https://api.github.com/users/Aktof/orgs","repos_url":"https://api.github.com/users/Aktof/repos","events_url":"https://api.github.com/users/Aktof/events{/privacy}","received_events_url":"https://api.github.com/users/Aktof/received_events","type":"User","site_admin":false},"created_at":"2016-11-16T23:01:34Z","updated_at":"2016-11-16T23:01:34Z","body":"Hey @wellyshen,\r\n\r\nCame across the same issue. Traced it back to Webpack 2 error as the compiler was being instantiated. It seems like setting external modules in the configuration to true currently isn't supported by the validation schema. It throws the following error internally.\r\n\r\n```\r\nSpecify dependencies that shouldn\\'t be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`.\r\n```\r\n\r\nWhich led me to the following part of the configuration:\r\n\r\n```\r\n...\r\n        externals: {\r\n          'react/addons': true,\r\n          'react/lib/ExecutionEnvironment': true,\r\n          'react/lib/ReactContext': true,\r\n        },\r\n...\r\n```\r\n\r\nI read the Webpack documentation stating that setting the value to true was the same as mirroring the property name for the internal require statements. So I changed the externals to the following:\r\n\r\n```\r\n        externals: {\r\n          'react/addons': 'react/addons',\r\n          'react/lib/ExecutionEnvironment': 'react/lib/ExecutionEnvironment',\r\n          'react/lib/ReactContext': 'react/lib/ReactContext',\r\n        },\r\n```\r\n\r\nThis should work as before. Still need to verify with some more tests. They are currently fixing this.\r\n\r\nhttps://github.com/webpack/webpack/issues/3299\r\n\r\nAll the best,\r\nShalom\r\n\r\nP.S. Awesome boilerplate repo's, great examples to learn from."}}
{"actor":{"display_login":"Aktof"}}