#Lustre dev server and error messages
1 messages Β· Page 1 of 1 (latest)
the dev server shows you the compiler errors on start, and also when you keep it running it will display an overlay
When you write overlay, is that in HTML?
both in the terminal and on the page
That's kind of what I expected, but I'm seeing neither..
is your editor writing backup files (with a tilde at the end) by any chance π
I'm not sure actually, I'm using a new editor too, Helix
yeah its a known issue
you can verify it by zdding
[editor]
atomic-save = false
in your helix config.toml
Note doing that does introduce a chance of file corruption on save if you have other tools that also work with the file at the same time
Ok, I've added it to my config.toml (after adding helix to my devenv.nix because my system version didn't recognize it). It doesn't seem to change anything though.. I'm not finding any temp files either, I'm assuming they'd be in src/ ?
If i rm -rf build it will show warnings from libraries on startup, but nothing from my src/ where I've intentinally introduced a typo
ok this might sound silly but:
if you open another terminal and open the file there again (or use cat) does the typo show up
but running gleam check doesn't report any errors?
gleam check shows the error as expected
Could it have something to do with all of this being run in a Nix environment (devenv)?
of course
nix breaks everything potentially
does it show up when you run gleam run -m lustre/dev build?
no
Ok here's something.. I deleted the dist directory and ran build again, and only the index.html was written
can you run the bun binary inside build/.lustre
it'd be helpful to share whatever output there is
thats not where it is
please
I'm not sure which output you want though.. Here's from lustre/dev build:
Compiled in 0.07s
Running lustre/dev.main
Creating JavaScript bundle...
β
Bundle successfully built.
β
HTML generated.
β
Build complete!
It looks the same when there's an error
I did find the bun binary at .lustre/bin/bun-linux-x64/bun if you want me to run it
nah
please π
That's a difficult question for a noob like me lol, how do I know?
type erl, it will print the version
Ok, yes,
Erlang/OTP 27 [erts-15.2.7.2] [source] [64-bit] [smp:32:16] [ds:32:16:10] [async-threads:1] [jit:ns]
you need otp 28 (and we need to do a better job detecting this)
what
Ok, so that's probably down to the version is in my nix/devenv channel or flake or whatever. That's what I get for trying to learn 5 new things at the same time
Thanks for the help!
i dont really know how nix works but nixpkgs does have 28.1
Yeah I don't really know how it works either yet, and I suspect whatever ends up in my env is not coming directly from nixpkgs..
I guess it's time to learn some more π¬
so anyway the problem here is the erlang function os:cmd that we use to run the gleam compiler has an option called exception_on_failure so you can know if the cmd failed or not, but this option was only added in otp 28
in older otp versions the cmd will just return the cmd output as a string but otherwise not indicate that it failed, so the rest of the dev tools process just happily continues
Right. That sounds like the kind of thing you'd want to know when executing a command..
yeah erlang is a bit shit for that kinda thing π
i think there are some other more-complicated ways to achieve a similar thing, but i was just reaching for the simplest
Sure. I'm pretty sure the docs mentioned something like "if you need more advanced features, use a dedicated build tool" so I'm not going to sue you for false advertisement π
Anyway, I guess I'll dig into this nix/devenv stuff some more and figure out how to get the right version. Thanks again for your help!
-# or just ditch nix
haha i'm tempted to but the siren song of disposable dev environments is too strong
disposable because when it doesnt work you can easily burn it down and use something else π
i jest i jest
well not to hurt anyone's feelings lol but i'm basically evaluating gleam/lustre to see if it can be a replacement for elm at this point
and i do definitely not want any javascript ecosystem stuff installed system wide
exciting
I did manage to get Erlang/OTP 28 installed, and everything is working great now π