Skip to content
Latchkey

PureScript "Unknown module" build error in CI

The PureScript compiler tried to resolve an import and found no module by that name in the compiled set. The package that provides it is not a dependency, or is not in the active package set.

What this error means

spago build / purs compile fails with "Error found:" and "Unknown module X" naming the module you imported.

PureScript
Error found:
in module Main
at src/Main.purs:3:1 - 3:24 (line 3, column 1 - line 3, column 24)

  Unknown module Effect.Aff

Common causes

The package is not a project dependency

The module lives in a package not listed in your spago dependencies, so the compiler never sees it.

The package is absent from the package set

The dependency is referenced but the active package set does not provide it at the resolved version.

How to fix it

Add the package that provides the module

  1. Identify which package exports the module (for example aff for Effect.Aff).
  2. Add it with spago so it joins your dependencies.
  3. Re-run spago build.
Terminal
spago install aff

Confirm the package set contains it

If the package is not in the set, add it as an extra dependency or update the set so the module resolves.

Terminal
spago build

How to prevent it

  • Add every imported package to spago dependencies before building.
  • Keep the package set version aligned with the packages you use.
  • Build locally so unknown-module errors surface before CI.

Frequently asked questions

What causes ""Unknown module""?
The module lives in a package not listed in your spago dependencies, so the compiler never sees it.
How do I fix "Unknown module"?
Add the package that provides the module

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card