Open vinjana opened 2 years ago
My guess is that you'll need to bump the Webpack version being used. You should be able to do that in your build.sbt
. Can you give that a try?
Oh. Sorry. I completely new to the stack (including JS). I realize now that the build.sbt
contains quite some configuration options. I'll try that.
O.k. the StackOverflow says this should be solved with webpack 5.54.0+.
Upgrading that in the build.sbt
results in Unsupported webpack major version 5
with scalajs-bundler 0.20.0.
Upgrading sbt-scalajs-bundler in the plugins.sbt
results in
[error] [webpack-cli] Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
[error] - configuration.devtool should match pattern "^(inline-|hidden-|eval-)?(nosources-)?(cheap-(module-)?)?source-map$".
[error] BREAKING CHANGE since webpack 5: The devtool option is more strict.
[error] Please strictly follow the order of the keywords in the pattern.
[error] - configuration.module.rules[1].use[0] has an unknown property 'query'. These properties are valid:
[error] object { ident?, loader?, options? }
[error] Failure on parsing the output of webpack: No content to map due to end-of-input
[error] at [Source: (ProcessPipeInputStream); line: 1, column: 0]
[error] You can try to manually execute the command
[error] node /home/kensche/private/nutriapp/my-app/target/scala-2.13/scalajs-bundler/main/node_modules/webpack/bin/webpack --profile --json --config /home/kensche/private/nutriapp/my-app/target/scala-2.13/scalajs-bundler/main/webpack-fastopt.config.js
[error]
[error] java.lang.RuntimeException: Non-zero exit code: 2
[error] at scala.sys.package$.error(package.scala:30)
[error] at scalajsbundler.Webpack$.$anonfun$run$2(Webpack.scala:286)
[error] at scala.util.Either.fold(Either.scala:192)
[error] at scalajsbundler.Webpack$.run(Webpack.scala:286)
[error] at scalajsbundler.Webpack$.bundleLibraries(Webpack.scala:222)
[error] at scalajsbundler.sbtplugin.LibraryTasks$.$anonfun$bundle$2(LibraryTasks.scala:76)
[error] at sbt.util.FileFunction$.$anonfun$cached$1(FileFunction.scala:80)
[error] at sbt.util.FileFunction$.$anonfun$cached$4(FileFunction.scala:153)
[error] at sbt.util.Difference.apply(Tracked.scala:414)
[error] at sbt.util.Difference.apply(Tracked.scala:394)
[error] at sbt.util.FileFunction$.$anonfun$cached$3(FileFunction.scala:149)
[error] at sbt.util.Difference.apply(Tracked.scala:414)
[error] at sbt.util.Difference.apply(Tracked.scala:389)
[error] at sbt.util.FileFunction$.$anonfun$cached$2(FileFunction.scala:148)
[error] at scalajsbundler.sbtplugin.LibraryTasks$.$anonfun$bundle$1(LibraryTasks.scala:79)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error] at sbt.std.Transform$$anon$4.work(Transform.scala:68)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:282)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
[error] at sbt.Execute.work(Execute.scala:291)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:282)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
[error] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[error] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error] at java.base/java.lang.Thread.run(Thread.java:829)
[error] (Compile / fastOptJS / webpack) Non-zero exit code: 2
[error] Total time: 25 s, completed Oct 3, 2022, 8:45:18 PM
So, upgrading the SBT plugin seems to help, but then the configurations in the project template seem not to match the expectations of webpack 5.
This is basically this issue from Stackoverflow.
Steps to reproduce