scala-js / vite.g8

Template for Scala.js with Vite
20 stars 2 forks source link

How does this differ from the Vite-Laminar-Livechart example? #4

Open spaceunifyfifty opened 4 months ago

spaceunifyfifty commented 4 months ago

Are there any differences worth noting between this g8 template repository and specifically the vite-end-state branch from the Getting Started with Scala.js and Vite guide?

As I only want a basic vite.js app without Laminar or Scalably typed, I think the single command

sbt new scala-js/vite.g8

would be easier than running

git clone https://github.com/sjrd/scalajs-sbt-vite-laminar-chartjs-example
mv scalajs-sbt-vite-laminar-chartjs-example my-project-name
cd my-project-name
git switch scalajs-vite-end-state
rm -rf .git

But I want to confirm that the end results will be equivalent. Thanks!

sjrd commented 4 months ago

It's intended to be basically the same, but they are not explicitly kept in sync.

spaceunifyfifty commented 4 months ago

It's intended to be basically the same, but they are not explicitly kept in sync.

Attempting to get this working on my system, sbt ~fastLinkJS yields

[info] started sbt server
java.lang.IllegalArgumentException: Invalid commands: 'fastLinkJS,

Am I supposed to compile this a different way?

sjrd commented 4 months ago

I just tried and that command worked as is. What system are you using? Perhaps ~ gets interpreted somehow? Try running sbt without argument, and only within sbt run ~fastLinkJS. That should rule out that hypothesis.

Also make sure you start the command when in the directory that contains the build.sbt file generated by the template.

spaceunifyfifty commented 4 months ago

I tried again, and now I running sbt yields

[info] welcome to sbt 1.8.2 (Homebrew Java 22.0.2)
error:
  bad constant pool index: 0 at pos: 49176
     while compiling: <no file>
        during phase: globalPhase=<no phase>, enteringPhase=<some phase>
     library version: version 2.12.17
    compiler version: version 2.12.17
  reconstructed args: -classpath /Users/user/.sbt/boot/scala-2.12.17/lib/scala-library.jar -Yrangepos

  last tree to typer: EmptyTree
       tree position: <unknown>
            tree tpe: <notype>
              symbol: null
           call site: <none> in <none>

full gist

sjrd commented 4 months ago

Ah you're running into a typical issue with recent Java versions + old sbt/Scala versions. We updated all the things in the vite-laminar-livechart repo but not here.