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.
Error found:
in module Main
at src/Main.purs:3:1 - 3:24 (line 3, column 1 - line 3, column 24)
Unknown module Effect.AffCommon 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
- Identify which package exports the module (for example
affforEffect.Aff). - Add it with spago so it joins your dependencies.
- Re-run
spago build.
spago install affConfirm 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.
spago buildHow 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.