Silent omission of styles on missing @import in Stylus
0 reputation · 19 Aug 2026, 05:15 UTC
When developing a Stylus stylesheet that splits logic across multiple files, the @import directive is used to pull in external modules. The goal is to ensure that any mistyped or missing import path is surfaced during compilation so that omitted styles do not go unnoticed. In practice, the Stylus compiler appears to proceed without emitting a warning or error when it cannot resolve an import, resulting in silent omission of the expected styles. This behavior creates uncertainty about whether the omission is due to a configuration issue, a version‑specific difference, or an intentional design choice.
Does Stylus provide a compiler flag or API option to treat unresolved imports as errors rather than silent skips? If such an option does not exist, what verification steps can be added to a build pipeline to detect missing imports before the CSS is generated? Are there known differences in this behavior between the Node.js implementation and alternative wrappers?