Did anyone have this issue after updating to Kotli...
# javascript
m
Did anyone have this issue after updating to Kotlin 1.7.0 when trying to use
jsBrowserProductionRun
or
jsBrowserDevelopmentRun
? The generated JS does work if I host it in a webserver manually. By looking at this (https://github.com/vaadin/flow/issues/13952), it seems that the
@webpack-cli/serve
package should be pinned to 1.6.1, and it seems that because the version is declared as "^1.6.1", it pulls version 1.7.0 to my project (well, at least that's what the yarn.lock file says 😛).
Copy code
* What went wrong:
Execution failed for task ':web:dashboard:frontend:jsBrowserProductionRun'.
> [webpack-cli] TypeError: cli.isMultipleCompiler is not a function
  [webpack-cli] TypeError: cli.isMultipleCompiler is not a function
      at Command.<anonymous> (C:\Users\Leonardo\Documents\IdeaProjects\LorittaBot\LorittaCinnamon\build\js\node_modules\@webpack-cli\serve\lib\index.js:146:35)
      at async Promise.all (index 1)
      at async Command.<anonymous> (C:\Users\Leonardo\Documents\IdeaProjects\LorittaBot\LorittaCinnamon\build\js\node_modules\webpack-cli\lib\webpack-cli.js:1674:7)
Copy code
"@webpack-cli/serve@^1.6.1":
  version "1.7.0"
  resolved "<https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.7.0.tgz#e1993689ac42d2b16e9194376cfb6753f6254db1>"
  integrity sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q==
s
you could also add to your gradle build:
Copy code
afterEvaluate {
	rootProject.extensions.configure<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension> {
				versions.webpackCli.version="4.10.0"
			}
		}
As curent webpack used is 4.9.2
👍 3
t
m
@turansky I tried using your plugin, buuut...
Copy code
* What went wrong:
Execution failed for task ':web:dashboard:frontend:jsPackageJson'.
> There is already declared version of 'webpack' with version '5.69.1' which does not intersects with another declared version '5.73.0'
t
You can remove
yarn.lock
before for “clean” check. Looks like lock update problem
m
Now it seems to work, yay! Thank you and thanks everyone that helped me with this issue (I also tried @Szymon Kaczorowski's solution and it also works) 🙂 Also on an unrelated note: Is incremental compilation broken? Enabling
<http://kotlin.incremental.js.ir|kotlin.incremental.js.ir>
causes a
Uncaught ReferenceError: send is not defined
when running the application (the
send
method seems to be from Ktor)
t
I use value classes and React. IR small fix required before 😞