Home > Software engineering >  ng test generates "TypeError: The 'compilation' argument must be an instance of Compi
ng test generates "TypeError: The 'compilation' argument must be an instance of Compi

Time:01-10

When I try to run unit tests with 'ng test libraryprojectname' I get the error below. ng build works fine though. The project in question is a workspace with an angular library. Any pointers on what to look for?

TypeError: The 'compilation' argument must be an instance of Compilation
    at Function.getCompilationHooks (C:\dev\MDM\node_modules\webpack\lib\javascript\JavascriptModulesPlugin.js:141:10)
    at SourceMapDevToolModuleOptionsPlugin.apply (C:\dev\MDM\node_modules\webpack\lib\SourceMapDevToolModuleOptionsPlugin.js:50:27)
    at C:\dev\MDM\node_modules\webpack\lib\SourceMapDevToolPlugin.js:163:53
    at Hook.eval [as call] (eval at create (C:\dev\MDM\projects\libraryprojectname\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:108:1)
    at Hook.CALL_DELEGATE [as _call] (C:\dev\MDM\projects\libraryprojectname\node_modules\tapable\lib\Hook.js:14:14)
    at Compiler.newCompilation (C:\dev\MDM\projects\libraryprojectname\node_modules\webpack\lib\Compiler.js:1122:26)
    at C:\dev\MDM\projects\libraryprojectname\node_modules\webpack\lib\Compiler.js:1166:29
    at Hook.eval [as callAsync] (eval at create (C:\dev\MDM\projects\libraryprojectname\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (C:\dev\MDM\projects\libraryprojectname\node_modules\tapable\lib\Hook.js:18:14)
    at Compiler.compile (C:\dev\MDM\projects\libraryprojectname\node_modules\webpack\lib\Compiler.js:1161:28)

CodePudding user response:

I read another post about the casing in the project path being the issue. I changed C:\dev\MDM... to C:\dev\mdm... & the error went away.

  • Related