Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read 'compilation' of undefined #29

Closed
Mossar opened this issue Apr 25, 2018 · 3 comments
Closed

Cannot read 'compilation' of undefined #29

Mossar opened this issue Apr 25, 2018 · 3 comments

Comments

@Mossar
Copy link

Mossar commented Apr 25, 2018

Hello!

I try to use your plugin with Webpack 2.1.0 and I get following error:

C:\Projekty\web-frontend\node_modules\git-revision-webpack-plugin\lib\build-file.js:6
  compiler.hooks.compilation.tap('compilation', (compilation) => {
                ^

TypeError: Cannot read property 'compilation' of undefined
at buildFile (C:\Projekty\web-frontend\node_modules\git-revision-webpack-plugin\lib\build-file.js:6:17)
    at GitRevisionPlugin.apply (C:\Projekty\web-frontend\node_modules\git-revision-webpack-plugin\lib\index.js:30:3)
    at Compiler.apply (C:\Projekty\web-frontend\node_modules\tapable\lib\Tapable.js:375:16)
    at WebpackOptionsApply.process (C:\Projekty\web-frontend\node_modules\webpack\lib\WebpackOptionsApply.js:58:18)
    at webpack (C:\Projekty\web-frontend\node_modules\webpack\lib\webpack.js:25:48)
    at Object.<anonymous> (C:\Projekty\web-frontend\conf\browsersync.conf.js:8:24)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Function.Module._load (C:\Projekty\web-frontend\node_modules\gulp-hub\lib\load-subfile.js:26:32)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Projekty\web-frontend\gulp_tasks\browsersync.js:5:25)
    at Module._compile (module.js:570:32)

Is it possible to run it with Webpack 2?

@simonfyi
Copy link
Contributor

Hi @Mossar,
v3.0.0 Is released with support for Webpack 4.
You could try using an older release, or upgrade to Webpack 4 (which might take you some time).

@pirelenito Maybe it's worth adding dependencies to the README. 😃

@pirelenito
Copy link
Owner

Thanks for the reply @simonfyi ❤️

I've just added a notice in the readme about version compatibility and how to use it with older versions of webpack.

@Mossar, while you don't upgrade to webpack 4 you can use an older version of this package:

npm install [email protected]

The only difference between that version and the latest is webpack 4 support.

@pirelenito
Copy link
Owner

I'll close the issue, but feel free to open it if you have move questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants