mzgoddard / jest-webpack

Use jest with webpack.
https://www.npmjs.com/package/jest-webpack
92 stars 21 forks source link

TypeError: Cannot read property 'compiler' of null #28

Open dylan-chong opened 6 years ago

dylan-chong commented 6 years ago
> ./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)
aistrati commented 6 years ago

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

dylan-chong commented 6 years ago

Nope

kmwarter commented 6 years ago

I'm having this same issue.

stephanschubert commented 6 years ago

Same here with webpack v4.14.0.

sergiomilici commented 6 years ago

Same problem.

boom commented 6 years ago

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

soeik commented 6 years ago

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

snowyu commented 6 years ago

Me too for using HtmlWebpackPlugin.

jwgmeligmeyling commented 5 years ago

Anyone had success with HtmlWebpackPlugin and Jest?