Solvedhappypack Happy id with query property in loader fails


          test:    /.js$/,
          exclude: /node_modules/,
          loader:  'babel',
          query:   babelrcJsonFileToObject,
          happy:   { id: 'babelJs' }
       plugins: [
          new HappyPack({ id: 'babelJs' }),

Fails with:

Module build failed: AssertionError: HappyPack: plugin for the loader 'babelJs?{"presets":["es2015-webpack","react","stage-0"],"plugins":["transform-runtime","transform-decorators-legacy","jsx-control-statements",["typecheck",{"disable":{"production":true}}]],"env":{"test":{"presets":["es2015-webpack","react","stage-0"],"plugins":["transform-runtime","transform-decorators-legacy","jsx-control-statements",["typecheck",{"disable":{"production":true}}]]},"browser":{"presets":["es2015-webpack","react","stage-0"],"plugins":["transform-runtime","transform-decorators-legacy","jsx-control-statements",["typecheck",{"disable":{"production":true}}],["react-transform",{"transforms":[{"transform":"react-transform-hmr","imports":["react"],"locals":["module"]},{"transform":"react-transform-catch-errors","imports":["react","redbox-react"]}]}]]},"production":{"presets":["es2015-webpack","react","stage-0"],"plugins":["transform-runtime","transform-decorators-legacy","jsx-control-statements","transform-flow-strip-types","react-remove-prop-types"]}}}'

could not be found! Did you forget to add it to the plugin list?
29 Answers

✔️Accepted Answer

You're still passing query to happypack's loader instead of babel. Remove query: {} from the object passed to loaders: [] and define your babel config in the happypack plugin:

    plugins: [
        new HappyPack({
            id: 'babel',
            loaders: [{
                path: 'babel',
                query: {
                    presets: ['react', 'es2015', 'stage-2'],
                    plugins: ['transform-object-assign']
            threadPool: happyThreadPool,
            cache: true,
            verbose: true

   loaders: [
            test: /\.(js|jsx)$/,
            exclude: /node_modules/,
            loader: ['happypack/loader?id=babel'],                

Related Issues:

happypack Incompatible with webpack@4.0.0-alpha.1 (the @next version as of now)
As webpack 4 comes out of alpha I'm getting the same error as @damianobarbati. happypack/lib/Webpack...
happypack Happy id with query property in loader fails
You're still passing query to happypack's loader instead of babel Using: Fails with: ...
webpack Cannot assign to read only property 'exports' of object '#<Object>' (mix require and export)
The code above is ok You can mix require and export You can't mix import and module.exports. ...
webpack How to exclude node_modules but one
@borm: a solution: Subj as example I create some module in another folder ( /projects/MY_MODULE ) MY...
webpack nodejs 17: digital envelope routines::unsupported
workaround: Bug report What is the current behavior? Other relevant information: webpack version: 5....
webpack TypeError: Data must be a string or a buffer
Here is a workaround to help you to find the wrong import Using the latest 2.2.0 release although th...
webpack webpack 4: access the mode flag from webpack.config.js file
This seems to work correctly with --mode production -p and <no flag> Do you want to request a featur...
webpack Webpack gives $ is not defined or jQuery is not defined error in console
Just use like this or add to webpack Do you want to request a feature or report a bug? What is the c...
webpack Error: Cannot find module 'webpack/lib/node/NodeTemplatePlugin'
I got this same error reinstalled it locally and ran it with package scripts and it worked npm remov...
webpack "Uncaught SyntaxError: Unexpected token <" error happened sometimes
I have a same problem fix with added <base href=/ /> into the <head> of my index.html ...
gradle No version of NDK matched the requested version 20.0.5594570. Versions available locally: 21.0.6113669
Can you check if there is any ndk-data locally in your sdk-directory? My SDK-Manager didn't show an ...
webpack [BUG?] npm link causes Webpack to look for babel-plugin in linked package node_modules.
try to add resolve: { symlinks: false } to your webpack.config I've linked a package that is outside...
webpack Parsing of import() fails in 4.29.0 (Compilation issue, related to dynamic import)
Running these commands fixes the problem in your repro @Dbuggerx It seem to be a npm problem ...
webpack webpack watch mode not working....
Try this workaround: Add this to your webpack configuration file: General Information: webpack versi...
gradle 5.0 - OutOfMemoryError: Java heap space
you are using the latest version of gradle wrapper? (./gradlew -v should give you the latest gradle ...
webpack webpack broken by ajv@6.9.0, "custom keyword definition is invalid: data.errors should be boolean"
If you use yarn add below to package.json then run yarn install if you use npm ...
vite Error: spawn C:\..\node_modules\esbuild\esbuild.exe ENOENT
I know how to fix it Run: node ./node_modules/esbuild/install.js This should be written in package.j...
webpack Webpack 2.0 doesn't support custom command line arguments?
Yes this is intended Custom argumens can be passed via --env prefix i e --env.compress ...
sbt Update to ncurses causes sbt to throw an exception on startup
I found using export TERM=xterm-color better than downgrading ncurses After upgrading ncurses ...
webpack error:'output.filename' is required, either in config file or as --output-filename"
exports not export,that is the reason. Do you want to request a feature or report a bug? bug What is...
parcel "Name already registered with serializer" with parcel@next
I was getting this issue after trying to switch from parcel-v1 to parcel-v2 Deleting node_modules an...
webpack DefinePlugin does not inject variable
Hmm I was just having this issue and it was trolling me process.env was showing as an empty object ...
parcel Cannot find module error when importing an static file using typescript
Create a .d.ts file in your project and put : It will instruct TypeScript to use any for all imports...
webpack Webpack moment.js integration
To the next person trying to get one of the above configurations to work (which they did not for me)...
webpack Strange warning stating that export does not exist when it does
Maybe this is not a bug Bug report What is the current behavior? Not sure if this is a problem with ...
parcel Bug: React not defined (with TypeScript)
I encountered this as well recently Using import * as React from 'react' worked for me Maybe you can...
parcel 🐛dist/ directory isn't cleaned on repeated builds
In package.json add another script named prebuild: prebuild will run automatically before the build ...
parcel Uncaught ReferenceError: regeneratorRuntime is not defined
how to solve ? If you are targeting modern browsers 🐛 bug report When I started using generators in...
webpack multiple usage of the CommonsChunkPlugin, only first works
The CommonsChunkPlugin selects only entry chunks Do you want to request a feature or report a bug? I...
webpack Using dynamic require on node targets WITHOUT resolve or bundle the target module
const server = __non_webpack_require__(entryPath) Do you want to request a feature or report a bug? ...
parcel Importing CSS from node_modules
I've been fighting with this for a while using .sassrc as a JSON object and yaml neither worked ...
webpack Webpack 4 chunking different runtime behaviour compared to Webpack 3
I stumbled upon such a configuration after trying many many variations Conceptually I'm not 100% sur...
webpack Error when trying to build bundle after upgrading to 4.20.0
Please read CHANGELOG Update internal struct...
parcel How to reference a scss files installed to node_modules?
You could try your luck with the tilde operator (~) to reference node_modules For example: ...
webpack Using webpack 4 on a large project (or, how to avoid "JavaScript heap out of memory" with production mode)
For those looking to increase the memory used by webpack Do you want to request a feature or report ...
webpack Webpack 4.0 file-loader json issue
I was able to copy my .json config file to the build folder using this: Do you want to request a fea...
webpack Module not found: Error: Cannot resolve 'file' or 'directory' (import sass with a relative font folder in webpack)
Just had this problem too It's an error in finding the right directory Use the path relative to / In...
sbt ZipException when switching from sbt 1.0 to sbt 0.13
and then works.. steps 1.Take an existing project port it to sbt 1.0 2 compile it with sbt 1.0 3 swi...
parcel JS and CSS files not found after parcel build
Sorry i forgot a dot try parcel build index.html --public-url ./ this is also documented on the doc ...
webpack import() support in webpack 2
import() reached stage-3 🎉 Domenic's import() proposal is as of last week stage-2 ...
webpack [NodeJS v.7] Webpack ERROR in Path must be a string. Received undefined
add a key 'publicPath' to the webpack config output node I'm update my node.js to version 7 ...
webpack BUG: "export 'default' (imported as 'selection_enter') was not found in './enter'
In case anyone stumbles across this thread.. Do you want to request a feature or report a bug? BUG W...
webpack Ability to export only module's default when building a library
Is seems this issue was solved by the libraryExport setting and should be closed. ...
webpack Error: Cannot find module 'webpack/lib/removeAndDo' when building a project
For me the issue was caused by extract-text-webpack-plugin module Older version of this package are ...
parcel CSS Module does not work
Currently you need to install postcss-modules in your app Thanks for your awesome tool ...
webpack require function is used in a way in which dependencies cannot be statically extracted
In case anyone else comes across this - I got this error because I was using module: umd in my tscon...
webpack Remove support for AMD by default in Webpack 2
You can opt-out Feel free to include a include property to limit the scope. I'm submitting a feature...
vite alias '@' to path.resolve(__dirname, './src') is not working
It's a bug It's fixed in 801951e but it also adds an easier way to alias a directory so you can just...
webpack module gets prioritised over main
I was having this exact problem Do you want to request a feature or report a bug? bug What is the cu...
webpack Webpack 4 hot rebuild time twice as slow
@Sojborg let try adding this line to the config: WARNING in configuration The 'mode' option has not ...