configuration has an unknown property 'applyWebpackOptionsDefaults'

See original GitHub issue

got this error when using react-scripts webpack config

 - configuration has an unknown property 'applyWebpackOptionsDefaults'. These properties are valid:
   object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, experiments?, externals?, externalsPresets?, externalsType?, ignoreWarnings?, infrastructureLogging?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, snapshot?, stats?, target?, watch?, watchOptions? }
   -> Options object as provided by the user.
   For typos: please correct them.
   For loader options: webpack >= v2.0.0 no longer allows custom properties in configuration.
     Loaders should be updated to allow passing options via loader options in module.rules.
     Until loaders are updated one can use the LoaderOptionsPlugin to pass these options to the loader:
     plugins: [
       new webpack.LoaderOptionsPlugin({
         // test: /\.xxx$/, // may apply this only for some modules
         options: {
           applyWebpackOptionsDefaults: …
         }
       })
     ]

What is the expected behavior?

Other relevant information: webpack version: “^5.21.2” Node.js version: v14.15.4 Operating System: ubuntu Additional tools:

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
yashmudgal05commented, Apr 5, 2022

@jasoncaii try to change in start.js by replacing below line:-

const compiler = createCompiler(webpack, config, appName, urls, useYarn);

Replace above line by

const compiler = createCompiler({webpack, config, appName, urls, useYarn});

Also try to replace loaders with rules in webpack.config.js file

0reactions
jasoncaiicommented, Apr 2, 2022

@yashmudgal05 Did you fixed it?I have the same problem 😂 Can you share the solution

Read more comments on GitHub >

github_iconTop Results From Across the Web

webpack error configuration.module has an unknown property ...
Webpack has been initialised using a configuration object that does not match the API schema. - configuration has an unknown property 'debug'.
Read more >
Webpack has been initialized using a configuration object
Webpack has been initialized using a configuration object that does not match the API schema. - configuration.module.rules[10] has an unknown property ...
Read more >
options has an unknown property 'before'. these ... - You.com
got this error when using react-scripts webpack config. - configuration has an unknown property 'applyWebpackOptionsDefaults'. These properties are valid: ...
Read more >
webpack打包报错:configuration has an unknown property ...
Webpack has been initialized using a configuration object that does not match the API schema. - configuration has an unknown property ...
Read more >
Webpack 5 Migration - Medium
property not required now. error: options has an unknown property 'prependData'. prependData -> additionalData; error: configuration.output has an unknown ...
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