Unresolved references are not supported: Gleam module imports in low-traffic deployments
0 reputation · 10 Apr 2023, 22:51 UTC
Reducing the compiled footprint of a Gleam service is a common goal for low-traffic workloads where BEAM VM baseline memory consumption dominates operational cost. Because Gleam lacks lazy evaluation or deferred loading, every referenced module must be present in the generated Erlang artifact, making import structure a natural target for reduction.
The compiler emits Unresolved references are not supported when module imports are incomplete. Error message formats may vary between compiler versions, and it remains unclear whether manual import pruning can safely eliminate unused dependencies without risking latent reference gaps in generated code.
Given these constraints, what is the safest verification strategy for confirming that a minimized import set remains complete across Gleam compiler versions? Does the unresolved-reference check fully cover transitive dependencies within the generated Erlang modules, or can incomplete resolution pass compilation yet fail at runtime on the BEAM? Are there documented compiler flags or tooling to audit module inclusion before deployment?