WebpackOptionsValidationError: Неверный объект конфигурации. Webpack был инициализирован с использованием объекта конфигурации, который не соответствует схеме API.
Я работаю в Angular 6 Project:
Я столкнулся с ошибкой при запуске ng test --code-coverage
. Но он работает нормально при работе ng test
и ng serve
и ng build
. Я пытался найти, чтобы решить эту проблему.
но я не могу решить это. Не могли бы вы решить эту проблему?
Подробная ошибка:
ng test --code-coverage
WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.module.rules[14].include should be one of these:
RegExp | string | function | [(recursive)] | object { and?, exclude?, include?, not?, or?, test? } | [RegExp | string | function | [(recursive)] | object { and?, exclude?, include?, not?, or?, test? }]
-> One or multiple rule conditions
Details:
* configuration.module.rules[14].include should be an instance of RegExp
* configuration.module.rules[14].include: The provided value "" is not an absolute path!
* configuration.module.rules[14].include should be an instance of function
* configuration.module.rules[14].include should be an array:
[RegExp | string | function | [(recursive)] | object { and?, exclude?, include?, not?, or?, test? }]
* configuration.module.rules[14].include should be an object.
* configuration.module.rules[14].include should be an array:
[RegExp | string | function | [(recursive)] | object { and?, exclude?, include?, not?, or?, test? }]
at webpack (D:\LTCProjects\AccessandWorkflow\UI\Dev\WorkFlow\node_modules\@angular-devkit\build-angular\node_modules\webpack\lib\webpack.js:31:9)
at init (D:\LTCProjects\AccessandWorkflow\UI\Dev\WorkFlow\node_modules\@angular-devkit\build-angular\src\angular-cli-files\plugins\packages\angular_devkit\build_angular\src\angular-cli-files\plugins\karma.ts:153:16)
at Array.invoke (D:\LTCProjects\AccessandWorkflow\UI\Dev\WorkFlow\node_modules\di\lib\injector.js:75:15)
at Injector.get (D:\LTCProjects\AccessandWorkflow\UI\Dev\WorkFlow\node_modules\di\lib\injector.js:48:43)
at config.frameworks.forEach (D:\LTCProjects\AccessandWorkflow\UI\Dev\WorkFlow\node_modules\karma\lib\server.js:154:61)
at Array.forEach (<anonymous>)
at Server._start (D:\LTCProjects\AccessandWorkflow\UI\Dev\WorkFlow\node_modules\karma\lib\server.js:154:23)
at Injector.invoke (D:\LTCProjects\AccessandWorkflow\UI\Dev\WorkFlow\node_modules\di\lib\injector.js:75:15)
at Promise.all.then.then (D:\LTCProjects\AccessandWorkflow\UI\Dev\WorkFlow\node_modules\karma\lib\server.js:127:24)
at tryCatcher (D:\LTCProjects\AccessandWorkflow\UI\Dev\WorkFlow\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (D:\LTCProjects\AccessandWorkflow\UI\Dev\WorkFlow\node_modules\bluebird\js\release\promise.js:512:31)
at Promise._settlePromise (D:\LTCProjects\AccessandWorkflow\UI\Dev\WorkFlow\node_modules\bluebird\js\release\promise.js:569:18)
at Promise._settlePromise0 (D:\LTCProjects\AccessandWorkflow\UI\Dev\WorkFlow\node_modules\bluebird\js\release\promise.js:614:10)
at Promise._settlePromises (D:\LTCProjects\AccessandWorkflow\UI\Dev\WorkFlow\node_modules\bluebird\js\release\promise.js:694:18)
at _drainQueueStep (D:\LTCProjects\AccessandWorkflow\UI\Dev\WorkFlow\node_modules\bluebird\js\release\async.js:138:12)
at _drainQueue (D:\LTCProjects\AccessandWorkflow\UI\Dev\WorkFlow\node_modules\bluebird\js\release\async.js:131:9)
Детали проекта: