Solvedhappypack Happy id with query property in loader fails

Using:

        {
          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:

27
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...
6
happypack Happy id with query property in loader fails
You're still passing query to happypack's loader instead of babel Using: Fails with: ...
811
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. ...
727
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...
488
webpack nodejs 17: digital envelope routines::unsupported
workaround: Bug report What is the current behavior? Other relevant information: webpack version: 5....
473
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...
296
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...
284
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...
233
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...
216
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 ...
194
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 ...
180
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...
177
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 ...
166
webpack webpack watch mode not working....
Try this workaround: Add this to your webpack configuration file: General Information: webpack versi...
152
gradle 5.0 - OutOfMemoryError: Java heap space
you are using the latest version of gradle wrapper? (./gradlew -v should give you the latest gradle ...
122
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 ...
113
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...
106
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 ...
103
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 ...
103
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...
97
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...
94
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 ...
84
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...
83
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)...
82
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 ...
78
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...
77
parcel 🐛dist/ directory isn't cleaned on repeated builds
In package.json add another script named prebuild: prebuild will run automatically before the build ...
71
parcel Uncaught ReferenceError: regeneratorRuntime is not defined
how to solve ? If you are targeting modern browsers 🐛 bug report When I started using generators in...
69
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...
67
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? ...
66
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 ...
64
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...
63
webpack Error when trying to build bundle after upgrading to 4.20.0
Please read CHANGELOG https://github.com/webpack/webpack/releases/tag/v4.20.0 Update internal struct...
62
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: ...
60
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 ...
60
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...
56
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...
52
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...
51
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 ...
49
webpack import() support in webpack 2
import() reached stage-3 🎉 Domenic's import() proposal is as of last week stage-2 ...
49
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 ...
49
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...
48
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. ...
48
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 ...
46
parcel CSS Module does not work
Currently you need to install postcss-modules in your app Thanks for your awesome tool ...
45
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...
45
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...
44
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...
44
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...
43
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 ...