ethul/purs-loader

Missing source dependencies inserts unexpected null

Opened this issue · 0 comments

belevy commented

If you are using spago build but do not set spago: true the resulting output will contain something like

import * as Control_Applicative null

and cause a bad error that isn't particularly helpful. Perhaps there is a way to explain that this is caused by failure to find that module in your sources?

The requirement that all dependencies be specified as sources is unexpected since spago build will already include these dependencies for you. One question I have is whether it even makes sense to do the rewriting for dependencies since the whole purpose of that code seems to be to teach webpack about the compilers graph.

This issue shows up even more obviously when using https://github.com/purifix/purifix which doesn't store the dependencies in a single folder but rather copies the outputs from the nix store (in order to support incremental recompilation across packages).

Perhaps I am just chafing against the compilation model of Purescript here and the best option is to just include source dependencies.