Building my application works fine. Also when I'm running ng test, the tests are ran just fine. But when the tests are ran, the following error occurs:
Generating browser application bundles (phase: setup)...<private path>/node_modules/webpack/lib/javascript/JavascriptModulesPlugin.js:164
throw new TypeError(
^
TypeError: The 'compilation' argument must be an instance of Compilation
at JavascriptModulesPlugin.getCompilationHooks (<private path>/node_modules/webpack/lib/javascript/JavascriptModulesPlugin.js:164:10)
at SourceMapDevToolModuleOptionsPlugin.apply (<private path>/node_modules/webpack/lib/SourceMapDevToolModuleOptionsPlugin.js:54:27)
at <private path>/node_modules/webpack/lib/SourceMapDevToolPlugin.js:184:53
at Hook.eval [as call] (eval at create (<private path>/submodules/shared-library/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:106:1)
at Hook.CALL_DELEGATE [as _call] (<private path>/submodules/shared-library/node_modules/tapable/lib/Hook.js:14:14)
at Compiler.newCompilation (<private path>/submodules/shared-library/node_modules/webpack/lib/Compiler.js:1126:26)
at <private path>/dev/evy/submodules/shared-library/node_modules/webpack/lib/Compiler.js:1170:29
at eval (eval at create (<private path>/submodules/shared-library/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:13:1)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Node.js v20.10.0
I have seen that this often occurs if there are different versions of webpack in the project. I have ran npm dedupeand have confirmed that the only version of webpack used now is 5.88.2.
I've also seen that this often occur on Windows, and has been fixed changing uppercase folders to lowercase. My problem occurs on a mac, and i only have lowercase folder names in my path to the project.
Does anyone have any ideas on where i can check next, to resolve this issue?