web-app-react-kotlin-js-gradle icon indicating copy to clipboard operation
web-app-react-kotlin-js-gradle copied to clipboard

Current version doesn't run

Open CfGit12 opened this issue 3 years ago • 2 comments

Just checked out the project and tried to run browserDevelopmentRun but it fails with:

[webpack-cli] TypeError: cli.isMultipleCompiler is not a function [webpack-cli] TypeError: cli.isMultipleCompiler is not a function at Command. (/Users/Charles.Flynn/IdeaProjects/CF/web-app-react-kotlin-js-gradle/build/js/node_modules/@webpack-cli/serve/lib/index.js:146:35) at async Promise.all (index 1) at async Command. (/Users/Charles.Flynn/IdeaProjects/CF/web-app-react-kotlin-js-gradle/build/js/node_modules/webpack-cli/lib/webpack-cli.js:1687:7)

I've been able to fix it by bumping the webpack version as follows in build.gradle.kts:

rootProject.plugins.withType(org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin::class.java) {
    rootProject.the<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension>().versions.webpackCli.version = "4.10.0"
}

Putting this here in case anyone else comes across it, and so it can be fixed to prevent others encountering this.

CfGit12 avatar Jun 24 '22 14:06 CfGit12

Thanks for the report, @CfGit12 . Indeed, there is a problem that's currently affecting other Kotlin/JS projects as well: https://youtrack.jetbrains.com/issue/KT-52776/ and https://youtrack.jetbrains.com/issue/KT-52890.

We'll update this tutorial with Kotlin 1.7.10, which also addresses this problem.

SebastianAigner avatar Jun 29 '22 12:06 SebastianAigner

Another snippet to downgrade the webpack version until we've addressed this:

rootProject.extensions.configure<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension> {
    versions.webpackCli.version = "4.10.0"
}

SebastianAigner avatar Jun 29 '22 12:06 SebastianAigner