Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

running sbt as a subprocess causes confusion #5

Open
scalway opened this issue May 1, 2023 · 2 comments
Open

running sbt as a subprocess causes confusion #5

scalway opened this issue May 1, 2023 · 2 comments

Comments

@scalway
Copy link

scalway commented May 1, 2023

I've installed sbt 1.6.1 in a system:

sbt --version
1.6.1

when I've tried to start vite dev server on
scalajs-sbt-vite-laminar-chartjs-example on branch laminar-end-state

$ npm run dev

> [email protected] dev
> vite

[info] welcome to sbt 1.8.2 (Ubuntu Java 11.0.18)
[info] loading settings for project global-plugins from common.sbt ...
[info] loading global plugins from /home/slovic/.sbt/1.0/plugins
[info] loading settings for project scalajs-sbt-vite-laminar-chartjs-example-build-build-build from metals.sbt ...

so it starts latest sbt version (as file build.properties defined) but sbt-runner version was still 1.6.1 so command failed as seen below:

...
[info] loading settings for project livechart from build.sbt ...
[info] set current project to livechart (in build file:./scalajs-sbt-vite-laminar-chartjs-example/)
[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:./scalajs-sbt-vite-laminar-chartjs-example/node_modules/@scala-js/vite-plugin-scalajs/dist/index.js:24:24)
    at ChildProcess.emit (node:events:527:28)
    at maybeClose (node:internal/child_process:1090:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)

I was able to fix it by simply install current sbt version:

$ cs install sbt

I really don't know what to do with that, it is not critical (simple OS config fix) but could be blocker for many if cannot find help :(.

@sjrd
Copy link
Member

sjrd commented May 1, 2023

Hum, so that's because you had previously installed an older version somewhere on your system, which took precedence?

We probably cannot really do anything about it. Perhaps the existence of this issue with the searchable error message will help future users to troubleshoot, if they end up in the same situation?

@gzm0
Copy link
Contributor

gzm0 commented May 3, 2023

What we could do is probe sbt --version and fail if it is too old (hopefully there is a "setup" hook for the plugin or something).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants