!kcOuJGXBoqBVSCYYAy:matrix.org

Scala JS

2133 Members
Scala.js, the Scala to JavaScript compiler9 Servers

Load older messages


SenderMessageTime
31 May 2024
@_discord_690242411146117177:t2bot.iosjrd If you have specific questions about Scala.js, we can help. But we won't do your homework for you. 😉 05:54:23
@_discord_834440762787364865:t2bot.io.pierrelm joined the room.09:25:42
@_discord_804952828853616650:t2bot.ioraulwastaken_ changed their display name from RaulWasTaken to raulwastaken_.12:32:14
@_discord_1225461269079920684:t2bot.ioalex037635 joined the room.20:30:22
@_discord_815546116066115595:t2bot.ionikitaga Hey folks, question for Windows users:

For typical Scala.js development, you run an sbt session with ~compile or ~fastLinkJS, and then also you start the Vite dev server, and if that uses the Scala.js vite plugin, that plugin also runs the sbt command when it starts. If you do this – does this work for you naturally? One person is reporting that they needed to specify SBT_SERVER_FORCESTART=1 env for that to work, otherwise they get a "could not create lock" error from sbt. And there's even an issue about that: https://github.com/sbt/sbt/issues/6777

I don't use Windows myself so I'm wondering if I need to include that in my instructions for Windows users.

And while we're on the topic, another Windows question right away: is Process("npm run build", ...) the correct way to run the npm script on Windows from build.sbt? Or does it need to be npm.cmd or npm.bat or cmd /c npm?
23:06:24
@_discord_815546116066115595:t2bot.ionikitaga * Hey folks, question for Windows users:

For typical Scala.js development, you run an sbt session with ~compile or ~fastLinkJS, and then also you start the Vite dev server, and if that uses the Scala.js vite plugin, that plugin also runs the sbt command when it starts. If you do this – does this work for you naturally? One person is reporting that they needed to specify SBT_SERVER_FORCESTART=1 env for that to work, otherwise they get a "could not create lock" error from sbt. And there's even an issue about that: https://github.com/sbt/sbt/issues/6777

I don't use Windows myself so I'm wondering if I need to include that in my instructions for Windows users (for the Laminar demo project).

And while we're on the topic, another Windows question right away: is Process("npm run build", ...) the correct way to run the npm script on Windows from build.sbt? Or does it need to be npm.cmd or npm.bat or cmd /c npm?
23:06:42
@_discord_815546116066115595:t2bot.ionikitaga * Hey folks, question for Windows users:

For typical Scala.js development, you run an sbt session with ~compile or ~fastLinkJS, and then also you start the Vite dev server, and if that uses the Scala.js vite plugin, that plugin also runs the sbt command when it starts. If you do this – does this work for you naturally? One person is reporting that they needed to specify SBT_SERVER_FORCESTART=1 env for that to work, otherwise they get a "could not create lock" error from sbt. And there's even a relevant issue: https://github.com/sbt/sbt/issues/6777

I don't use Windows myself so I'm wondering if I need to include that in my instructions for Windows users (for the Laminar demo project).

And while we're on the topic, another Windows question right away: is Process("npm run build", ...) the correct way to run the npm script on Windows from build.sbt? Or does it need to be npm.cmd or npm.bat or cmd /c npm?
23:07:27
@_discord_192322936219238400:t2bot.ioaly.fish cmd /c npm is the safest way 23:09:48
@_discord_192322936219238400:t2bot.ioaly.fishimage.png
Download image.png
23:10:07
@_discord_192322936219238400:t2bot.ioaly.fish for me, npm wouldn't get picked up by Process 23:10:07
@_discord_192322936219238400:t2bot.ioaly.fish
scala> new ProcessBuilder("npm")
val res0: ProcessBuilder = java.lang.ProcessBuilder@28b68067

scala> res0.inheritIO
val res1: ProcessBuilder = java.lang.ProcessBuilder@28b68067

scala> res1.start
java.io.IOException: Cannot run program "npm": CreateProcess error=2, The system cannot find the file specified
  at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1170)
  at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1089)
  ... 30 elided
23:11:50
@_discord_192322936219238400:t2bot.ioaly.fish
scala> new ProcessBuilder("cmd", "/c", "npm")
val res3: ProcessBuilder = java.lang.ProcessBuilder@1802f60c

scala> res3.inheritIO.start
val res4: Process = Process[pid=492, exitValue="not exited"]
23:12:18
@_discord_815546116066115595:t2bot.ionikitaga aly.fish Thanks, what about npm.cmd, does that ring a bell on Windows? From what I've read it seems to be a more direct Windows alternative to running npm command on other systems, in that cmd /c npm executes npm in a clean environment without inheriting env vars (or something like that) which is not typically the case. 23:35:49
@_discord_815546116066115595:t2bot.ionikitaga * aly.fish Thanks! What about npm.cmd, does that ring a bell on Windows? From what I've read it seems to be a more direct Windows alternative to running npm command on other systems, in that cmd /c npm executes npm in a clean environment without inheriting env vars (or something like that) which is not typically the case. 23:35:57
@_discord_192322936219238400:t2bot.ioaly.fish cmd /c npm will look for all 3 of npm.cmd npm.ps1 npm.exe 23:36:16
@_discord_815546116066115595:t2bot.ionikitaga * aly.fish Thanks! What about npm.cmd, does that ring a bell on Windows? From what I've read it seems to be a more direct Windows alternative to running npm command on other systems, in that cmd /c npm executes npm in a clean environment without inheriting env vars (or something like that) which is not typically the case when just running npm. 23:36:20
@_discord_815546116066115595:t2bot.ionikitaga And a user may have one of them but not others, e.g. if they installed npm in a different way? 23:36:59
@_discord_192322936219238400:t2bot.ioaly.fish Yep 23:37:04
@_discord_815546116066115595:t2bot.ionikitaga I see, thanks, I guess I'll need to do that. 23:37:25
1 Jun 2024
@_discord_134934145049559040:t2bot.iogranarder On the lock question - running sbt ~fastLinkJS followed by starting Vite fails for me for the same lock issue that you mentioned. I'm not using the plugin, but my setup is equivalent. I also wasn't aware of the SBT_SERVER_FORCESTART option, so I'd typically just start the Vite server first and queue the sbt session afterwards. 04:54:43
@_discord_815546116066115595:t2bot.ionikitaga Huh. What about running SBT ~fastLinkJS in one tab, and running the auto-reloading backend server via sbt in another tab, does that not work either on Windows? I don't think I've ever run into this error on macros, doing all kinds of things. 04:58:56
@_discord_815546116066115595:t2bot.ionikitaga * Huh. What about running SBT ~fastLinkJS in one tab, and running the auto-reloading backend server via sbt in another tab, does that not work either on Windows? I don't think I've ever run into this error on macos, doing all kinds of things. 04:59:24
@_discord_134934145049559040:t2bot.iogranarder Nah, that doesn't work either for me. I'm always running these commands in separate terminals anyway. 05:00:08
@_discord_134934145049559040:t2bot.iogranarder If the terminal running sbt ~fastLinkJS is the one that is unable to acquire the lock (i.e. if it attempts to get the lock while the command to start Vite is grabbing the sbt output directory for your JS files), then sbt gives you a prompt that allows you to start a new server instead of just failing. I've not looked into whether there's an option you could provide to sbt to always do that though (outside of the env var you mentioned). 05:04:40
@_discord_298173543764459520:t2bot.ioScalable Cucumber joined the room.12:17:28
2 Jun 2024
@_discord_196624010761601024:t2bot.ioheko_ joined the room.11:17:34
3 Jun 2024
@_discord_1153934720162349117:t2bot.iobluxwarrior_66894 joined the room.01:23:50
@kike356:matrix.orgkike jovel joined the room.04:51:04
@_discord_632658164696743936:t2bot.iolrytz changed their profile picture.12:22:25
@_discord_594749312123142149:t2bot.ioquafadas As a follow up to this, I did the detail grind on this idea, the test suite is now a lot more polished, and I think it is useable by someone who is "not me". If this takes longer than 20 second or so, then I guess it needs more polish!


18:10:52

Show newer messages


Back to Room ListRoom Version: 9