[webpack-cli] Invalid configuration object

Hi. I am having problems to run a completely new Kotlin/JS-React project created with IntelliJ.
Despite the successfull build, I am getting a webpack-cli error complaining about invalid configuration.

07:47:35: Executing task 'browserProductionRun --continuous'...

Starting Gradle Daemon...
Gradle Daemon started in 2 s 8 ms
> Task :kotlinNodeJsSetup SKIPPED
> Task :packageJson
> Task :rootPackageJson

> Task :kotlinNpmInstall
warning workspace-aggregator-d23f4bbc-3257-43a8-b0ed-b2a2f619db62 > BuildCheck > webpack-dev-server > sockjs > uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
warning workspace-aggregator-d23f4bbc-3257-43a8-b0ed-b2a2f619db62 > BuildCheck > webpack-dev-server > url > querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
warning "workspace-aggregator-d23f4bbc-3257-43a8-b0ed-b2a2f619db62 > BuildCheck > kotlin-wrappers-kotlin-react-redux-js-legacy > react-redux@7.2.4" has unmet peer dependency "react@^16.8.3 || ^17".
warning "workspace-aggregator-d23f4bbc-3257-43a8-b0ed-b2a2f619db62 > BuildCheck > kotlin-wrappers-kotlin-react-router-dom-js-legacy > react-router-dom@5.2.0" has unmet peer dependency "react@>=15".
warning "workspace-aggregator-d23f4bbc-3257-43a8-b0ed-b2a2f619db62 > BuildCheck > kotlin-wrappers-kotlin-styled-js-legacy > styled-components@5.3.0" has unmet peer dependency "react@>= 16.8.0".
warning "workspace-aggregator-d23f4bbc-3257-43a8-b0ed-b2a2f619db62 > BuildCheck > kotlin-wrappers-kotlin-styled-js-legacy > styled-components@5.3.0" has unmet peer dependency "react-dom@>= 16.8.0".
warning "workspace-aggregator-d23f4bbc-3257-43a8-b0ed-b2a2f619db62 > BuildCheck > kotlin-wrappers-kotlin-styled-js-legacy > styled-components@5.3.0" has unmet peer dependency "react-is@>= 16.8.0".
warning "workspace-aggregator-d23f4bbc-3257-43a8-b0ed-b2a2f619db62 > BuildCheck > kotlin-wrappers-kotlin-react-dom-js-legacy > react-dom@17.0.2" has unmet peer dependency "react@17.0.2".
warning "workspace-aggregator-d23f4bbc-3257-43a8-b0ed-b2a2f619db62 > BuildCheck > kotlin-wrappers-kotlin-react-router-dom-js-legacy > react-router-dom > react-router@5.2.0" has unmet peer dependency "react@>=15".
warning "workspace-aggregator-d23f4bbc-3257-43a8-b0ed-b2a2f619db62 > BuildCheck > kotlin-wrappers-kotlin-react-router-dom-js-legacy > react-router-dom > react-router > mini-create-react-context@0.4.1" has unmet peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0 || ^17.0.0".

> Task :generateExternalsIntegrated

> Task :compileKotlinJs
w: C:\dev\projekte\prototypes\BuildCheck\src\main\kotlin\Welcome.kt: (19, 2): This declaration is experimental and its usage should be marked with '@kotlin.js.ExperimentalJsExport' or '@OptIn(kotlin.js.ExperimentalJsExport::class)'
w: C:\dev\projekte\prototypes\BuildCheck\src\main\kotlin\Welcome.kt: (20, 7): Exported declaration uses non-exportable super type: RComponent<WelcomeProps, WelcomeState>
w: C:\dev\projekte\prototypes\BuildCheck\src\main\kotlin\Welcome.kt: (20, 7): Exported declaration uses non-exportable super type: Component<WelcomeProps, WelcomeState>

> Task :processDceKotlinJs
> Task :processResources
> Task :browserProductionRun

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 1m 7s
8 actionable tasks: 8 executed

Waiting for changes to input files of tasks... (ctrl-d then enter to exit)
[webpack-cli] Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
 - configuration has an unknown property '_assetEmittingWrittenFiles'. These properties are valid:
   object { bonjour?, client?, compress?, dev?, firewall?, headers?, historyApiFallback?, host?, hot?, http2?, https?, liveReload?, onAfterSetupMiddleware?, onBeforeSetupMiddleware?, onListening?, open?, port?, proxy?, public?, setupExitSignals?, static?, transportMode?, watchFiles? }

1 Like

Downgrading Kotlin/JS-Plugin to 1.5.0 seems to solve the problem.

1 Like

Check this issue: https://youtrack.jetbrains.com/issue/KT-48273

2 Likes

Thanks a lot, István!