When trying to compile my ghcjs/jsaddle based Haskell website, I get
Main.hs:20:1: error:
Failed to load interface for ‘GHCJS.DOM.Element’
It is a member of the hidden package ‘jsaddle-dom-0.9.2.0’.
Perhaps you need to add ‘jsaddle-dom’ to the build-depends in your .cabal file.
Use -v to see a list of the files searched for.
even though jsaddle-dom is already in the build-depends of my cabal file.
So I can't do what the error message suggests.
What's going on?
You should put
build-depends: ghcjs-dominstead ofbuild-depends: jsaddle-domin your cabal file.This is because
ghcjs-domis the multiplexer between the realghcjs-dom-jsffiandjsaddle-dom.Check out the ghcjs-dom cabal file to see that.
Why is ghc's error message so misleading? Thanks to
jonoredfrom the#reflex-frpfreenode IRC channel for this explanation: