Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 502 Vote(s) - 3.47 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Kotlin/JS, Gradle Plugin : Unable to load '@webpack-cli/serve' command

#1
I was doing the tutorial for React Kotlin and couldnt even finish the setup step because the server does not start.

The code is unchanged :

[To see links please register here]


Stacktrace:

[webpack-cli] Unable to load '@webpack-cli/serve' command
[webpack-cli] TypeError: options.forEach is not a function
[webpack-cli] TypeError: options.forEach is not a function


I saw this issue :

[To see links please register here]

but I'm unable to implement the fix proposed (change the webpack-cli version and remove the webpack-cli/serve from yarn.lock) because I can't find how to change these on the kotlin js gradle plugin.


Even simple browser application from intelliJ is broken with the same error.
Reply

#2
Try to update webpack-cli:

```
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.9.0"
}
```
Reply

#3
Had the same issue: adding this option to the project gradle.properties

kotlin.js.webpack.major.version=4


fixed it - reference:

[To see links please register here]


Reply

#4
Evgeny's answer didn't work here.
Now after 2 days of banging head, and reading kotlin plugin source-code, only the following worked here:
```build.gradle
// build.gradle.kts file
kotlinYarn {
resolution("webpack", "5.73.0")
resolution("webpack-cli", "4.10.0")
}
```
It will print a warning when running the task kotlinNpmInstall but the app will run.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through