Does this look like something easy to fix? https://github.com/roc-lang/roc/issues/7429
It's giving me grief upgrading the webserver demo's and using Isaac's RTL templating engine
I didn't repro with latest nightly
What version of Roc are you using?
Built from source
$ roc version
roc built from commit 06e78daa91, committed at 2024-12-28 22:05:45 UTC
oh wait, let me update the Issue, it needs to be in a sub-folder
Like
$ roc check src/Views/broken.roc
An internal compiler expectation was broken.
This is definitely a compiler bug.
Please file an issue here: <https://github.com/roc-lang/roc/issues/new/choose>
Outstanding references to the derived module
Location: crates/compiler/load_internal/src/file.rs:3358:29
Sorry, I hadn't realised the folder thing was relevant here
The whole derived_module
thing looks a bit confusing.
I'm unable to replicate
I checked out the commit, created a --release build, and ran roc/target/release/roc check src/Views/broken.roc
~/dev
❯ roc/target/release/roc check src/Views/broken.roc
0 errors and 0 warnings found in 29 ms.
Is this in the roc-htmx-tailwind repo?
Oh, that repo
https://github.com/lukewilliamboswell/roc-htmx-tailwindcss-demo/tree/upgrade-0.11.0
Yeah, if you checkout that branch and add the file src/Views/broken.roc
you should get;
$ roc check src/Views/broken.roc
An internal compiler expectation was broken.
This is definitely a compiler bug.
Please file an issue here: <https://github.com/roc-lang/roc/issues/new/choose>
Outstanding references to the derived module
Location: crates/compiler/load_internal/src/file.rs:3358:29
It also happens with $ roc check src/Views/Pages.roc
but the broken.roc
is a super small repro
Okay, got it with Layout.roc
Well, it also works with just module []
in broken.roc
ohk, interesting
So this isn't a "minimal" repro IMO since I think the problem is elsewhere
Ok heres a minimal repro https://github.com/lukewilliamboswell/roc-htmx-tailwindcss-demo/tree/broken
There's only two files in there, the broken.roc
and a minimal main.roc
referencing the new webserver
Okay, that's minimal
I wonder if it happens with basic-cli
1 sec
Yeah it does. Just pushed a commit changing the main.roc
to
app [main!] { pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.17.0/lZFLstMUCUvd5bjnnpYromZJXkQUrdhbva4xdBInicE.tar.br" }
main! = \_ -> Err TODO
Okay, then it's maybe not a platform problem?
No it's definitely the compiler
Oh, it's definitely the compiler
I mean whether this happens in just a Roc package vs. a platform
In this case it's neither of those... this has an app module at the root, the parent folder from the module we are checking
Can you update the GH issue?
done
That’s weird. Can you check the compiler commit right before my change to package headers?
If that works it’s an easy bisect :blush:
And you get the added pleasure of shaming me
the bug is present before that
37 messages were moved here from #compiler development > casual conversation by Luke Boswell.
is this a valid way to use a value from a platform?
module []
import pf.Stderr
foo = Stderr.line
i understand the problem well I think. The issue is that when a module is checked, if there is a transitive platform found, that platform is also placed into the queue of modules to resolve (https://github.com/roc-lang/roc/blob/723e35f11e1b1744c77cde77e42ed2b48fff12a6/crates/compiler/load_internal/src/file.rs#L1300-L1361). However if the module doesn't use the platform, it will finish all its computation before the platform has had a chance to, hence the panic. I think probably (?) the right way to do this is to only traverse to find the package if it doesn't exist in the package shorthand list, and then add it as a dependency of the module, but I don't totally understand all the flow here and Ive run out of tie
Last updated: Jul 06 2025 at 12:14 UTC