When the sbt launcher script version is too old, users are getting this error:
[error] Expected symbol
[error] Not a valid command: --
[error] Expected 'debug'
[error] Expected 'info'
[error] Expected 'warn'
[error] Expected 'error'
[error] Expected 'addPluginSbtFile'
[error] --batch
[error] ^
error when starting dev server:
Error: sbt invocation for Scala.js compilation failed with exit code 1.
at ChildProcess.<anonymous> (file:///C:/Users/valck/Projects/Laminar/2.%20Example%20Projects/laminar-full-stack-demo-master/client/node_modules/@scala-js/vite-plugin-scalajs/dist/index.js:24:24)
at ChildProcess.emit (node:events:514:28)
at maybeClose (node:internal/child_process:1105:16)
at ChildProcess._handle.onexit (node:internal/child_process:305:5)
This is easy to run into because the problem is with sbt script version, not the sbt project version. This is the version of sbt that the user downloaded to install the sbt script, not the version specified in the project's build.properties. I'm guessing some people rarely if ever update the sbt script version because sbt manages the project versions just fine most of the time. My sbt script version was 0.13.x before I ran into this issue, and someone else ran into the same issue with sbt script version 1.2.x.
Unfortunately, detecting sbt version using sbt --version is very slow (a few seconds). I'm also not sure if --version is available with sbt 0.13.x script version. I'm not sure if there are any other ways to check sbt version more efficiently.
I think the easiest way to improve UX is to detect the failure and tell the users to update sbt if [error] Not a valid command: -- is found in the error output. What do you think?
I think the easiest way to improve UX is to detect the failure and tell the users to update sbt if [error] Not a valid command: -- is found in the error output. What do you think?
When the sbt launcher script version is too old, users are getting this error:
This is easy to run into because the problem is with sbt script version, not the sbt project version. This is the version of sbt that the user downloaded to install the sbt script, not the version specified in the project's
build.properties
. I'm guessing some people rarely if ever update the sbt script version because sbt manages the project versions just fine most of the time. My sbt script version was 0.13.x before I ran into this issue, and someone else ran into the same issue with sbt script version 1.2.x.Unfortunately, detecting sbt version using
sbt --version
is very slow (a few seconds). I'm also not sure if--version
is available with sbt 0.13.x script version. I'm not sure if there are any other ways to check sbt version more efficiently.I think the easiest way to improve UX is to detect the failure and tell the users to update sbt if
[error] Not a valid command: --
is found in the error output. What do you think?