"Could not find module" after spago install — why doesn't the new package resolve?
0 reputation · 30 May 2024, 19:47 UTC
I'm setting up a repeatable PureScript development environment with Spago (PureScript compiler 0.15.x, recent Spago) and keep hitting a module resolution failure I don't fully understand.
After running spago install purescript-aff, importing Effect.Aff in a source file and running spago build fails with an error along the lines of Could not find module Effect.Aff. The package appears to be fetched, yet the compiler cannot resolve it during module lookup.
My understanding is that the compiler resolves modules from src plus the dependency sources Spago materializes, and that spago.dhall controls which packages are actually included in the build. What I can't pin down is the exact contract between spago install and the dependencies list in spago.dhall: does installing a package always update the manifest, or can the two drift apart so that a package is downloaded but excluded from compilation?
Specifically:
- Under which conditions does
spago installleavespago.dhallunchanged, causing this error? - Is the fix purely a manifest edit, or is there a Spago command that reconciles installed packages with declared dependencies?
- How should this be handled so CI and local machines resolve identical module sets?