S0001: program must define exactly one main!
Generated from rellum-diagnostics/src/db.rs.
Explanation
A Rellum executable needs one reactive entry point so the runtime knows which effect graph to run. With no main! binding there is no program entry point; with multiple main! bindings the compiler cannot choose which one owns the program lifecycle.
Common causes
- forgetting to add a main! effect binding
- copying an example and leaving two main! bindings in one module
- keeping an old debug main! after adding the real entry point
Canonical fixes
- add one main! binding if the program has none
Before:
value = 42
After:
value = 42
main! = print!(value)
- merge multiple startup effects into one main! chain
Before:
main! = print!("ready")
main! = write!("build/log.txt", "ready")
After:
main! = print!("ready") -> write!("build/log.txt", "ready")
Code example
value = 42