compiler.plugin is not a function

See original GitHub issue

I’m following the Browsersync - Webpack + React Hot Loader / React Transform HMR recipes trying to add hot-loader into my Gulp build system, but, I’m seeing the following error and I’m not sure to understand how this works in order to determine if this is an issue.

[19:41:07] TypeError: compiler.plugin is not a function
    at module.exports (Z:\development\reactjs\node_modules\webpack-dev-middleware\middleware.js:35:11)
    at Gulp.<anonymous> (Z:\development\reactjs\gulpfile.js:271:17)
    at module.exports (Z:\development\reactjs\node_modules\orchestrator\lib\runTask.js:34:7)
    at Gulp.Orchestrator._runTask (Z:\development\reactjs\node_modules\orchestrator\index.js:273:3)
    at Gulp.Orchestrator._runStep (Z:\development\reactjs\node_modules\orchestrator\index.js:214:10)
    at Gulp.Orchestrator.start (Z:\development\reactjs\node_modules\orchestrator\index.js:134:8)
    at C:\Users\geedmo\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:129:20
    at doNTCallback0 (node.js:419:9)
    at process._tickCallback (node.js:348:13)
    at Function.Module.runMain (module.js:469:11)

Any thoughts?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:2
  • Comments:8

github_iconTop GitHub Comments

15reactions
geedmocommented, Feb 16, 2016

My fault, was using webpack-stream

7reactions
kimowncommented, Dec 25, 2016

I get the same error, because I use webpack.config.js directly, like this:

let config = require('./webpack.config')
let server = new WebpackDevServer(config,{})

the right code is (you need to require webpack first)

let config = require('./webpack.config')
let server = new WebpackDevServer(webpack(config),{})

http://webpack.github.io/docs/webpack-dev-server.html#api

Read more comments on GitHub >

github_iconTop Results From Across the Web

compiler.plugin is not a function at ReactLoadablePlugin ...
The issue is likely that you try to use a Webpack 4 plugin with Webpack 5, just Webpack has uninformative error ...
Read more >
v5: [webpack-cli] TypeError: compiler.plugin is not a function
Bug report. What is the current behavior? Made all suggestions for v4->v5 try to run dev configuration with webpack serve and got the...
Read more >
[Solved]-TypeError: compiler.plugin is not a function at ...
The issue is likely that you try to use a Webpack 4 plugin with Webpack 5, just Webpack has uninformative error messages. Try...
Read more >
Calcite Components with Webpack 5 - Esri Community
I am trying to incorporate Calcite Components into a Webpack 5 app. After following the steps outlined in the readme and then serving...
Read more >
Plugins - webpack
A webpack plugin is a JavaScript object that has an apply method. This apply method is called by the webpack compiler, giving access...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found