jest-webpack icon indicating copy to clipboard operation
jest-webpack copied to clipboard

TypeError: Cannot read property 'compiler' of null

Open dylan-chong opened this issue 7 years ago • 9 comments

> ./node_modules/.bin/jest-webpack
/Users/Dylan/Development/PrivateUniProjects/my-repo-game-3/node_modules/jest-webpack/src/shared-data.js:149
      const shortResource = relative(this.compilation.compiler.options.context, resource);
                                                     ^

TypeError: Cannot read property 'compiler' of null
    at SharedData.compileFile (/Users/Dylan/Development/PrivateUniProjects/my-repo-game-3/node_modules/jest-webpack/src/shared-data.js:149:54)
    at SharedData.compileModule (/Users/Dylan/Development/PrivateUniProjects/my-repo-game-3/node_modules/jest-webpack/src/shared-data.js:275:10)
    at resolver (/Users/Dylan/Development/PrivateUniProjects/my-repo-game-3/node_modules/jest-webpack/src/entry-reference-plugin.js:73:24)
    at process.nextTick (/Users/Dylan/Development/PrivateUniProjects/my-repo-game-3/node_modules/webpack/lib/NormalModuleFactory.js:196:7)
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)

dylan-chong avatar May 31 '18 01:05 dylan-chong

@dylan-chong Did you figured out how to solve this error ?

aistrati avatar Jul 03 '18 08:07 aistrati

Nope

dylan-chong avatar Jul 03 '18 09:07 dylan-chong

I'm having this same issue.

kmwarter avatar Jul 05 '18 21:07 kmwarter

Same here with webpack v4.14.0.

stephanschubert avatar Aug 30 '18 11:08 stephanschubert

Same problem.

sergiomilici avatar Aug 30 '18 17:08 sergiomilici

FYI, this happened to me when trying to use HtmlWebpackPlugin for my webpack config during testing. Removing the plugin fixed the issue.

boom avatar Sep 25 '18 02:09 boom

Same problem with DojoWebpackPlugin. But I can't remove it. :(

soeik avatar Sep 30 '18 15:09 soeik

Me too for using HtmlWebpackPlugin.

snowyu avatar Oct 10 '18 07:10 snowyu

Anyone had success with HtmlWebpackPlugin and Jest?

jwgmeligmeyling avatar Jun 19 '19 16:06 jwgmeligmeyling