task jsBrowserDevelopmentRun is throwing a weird w...
# javascript
a
task jsBrowserDevelopmentRun is throwing a weird webpack error. This thing was running a few runs ago
Copy code
jsBrowserDevelopmentRun FAILED
[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? }
Help? Kotlin 1.5.10
t
Do you have custom dev-server configuration scripts?
g
Same problem here :
t
I use following versions and have no such problems:
Copy code
webpack.version = "5.50.0"
webpackCli.version = "4.7.2"                webpackDevServer.version = "4.0.0-rc.0"
j
+1, this problem also suddenly started happening in my own independent project
as a workaround, setting "kotlin.js.webpack.major.version=4" in gradle.properties is working for me, at least, but I have no dependencies on webpack 5. Kotlin 1.5.20
🙌 1
j
I got the same error also with Kotlin 1.5.30-RC... @Jeff Davidson Thanks for posting the workaround! Hopefully this get fixed soon 🙂 @turansky By default the
jsRun
task downloads the webpack version
5.38.1
and webpack-cli version
4.7.1
in my project when using Kotlin
1.5.30-RC
which i can see in the node_modules folder. Is there are way to update this versions?
i
@andylamax Could you, please, fill the issue in our YouTrack and attach a sample project, so we could reproduce the issue Or is it the same problem as described here ? https://youtrack.jetbrains.com/issue/KT-48273
o
@Ilya Kalibrov [JB] it's the same problem as KT-48273
🙏 1
i
JFYI: this issue seems obsolete for new IR BE. If you have reproduced it with IR, please, let me know
p
@Ilya Kalibrov [JB] I'm using IR, and I have this issue since today.
☝️ 1
🙏 1
a
Tried setting
Copy code
kotlin.js.webpack.major.version=4
in gradle.properties And now I am getting
Copy code
Execution failed for task jsBrowserDevelopmentRun
> ✖ 「wds」: webpack Dev Server Invalid Options
  
  options should NOT have additional properties
Copy code
rootProject.plugins.withType(org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin::class.java) {
    rootProject.the<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension>().versions.webpackDevServer.version =
        "4.0.0-rc.0"
}
worked for me
👍 2
r
c
Thanks a lot to everyone in this thread, I was becoming crazy trying to understand it :/
g
Thanks your code worked for me @andylamax 🙌