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-dom
instead ofbuild-depends: jsaddle-dom
in your cabal file.This is because
ghcjs-dom
is the multiplexer between the realghcjs-dom-jsffi
andjsaddle-dom
.Check out the ghcjs-dom cabal file to see that.
Why is ghc's error message so misleading? Thanks to
jonored
from the#reflex-frp
freenode IRC channel for this explanation: