Haskell Stack依赖损坏问题求助:GHCJS构建失败
tagged and semigroupoids Hey there, I’ve run into similar dependency hiccups when getting started with GHCJS and reflex-dom, so let’s walk through how to resolve this:
What’s causing the issue?
This isn’t a problem with your setup—it’s a version mismatch in the Stackage snapshot you’re using. The ghcjs-0.2.0 package depends on semigroupoids-5.0.0.4, which requires tagged >=0.8.5 && <1, but your current Stack resolver is pulling in tagged-0.8.1 which doesn’t meet that requirement.
Step-by-step fixes
Manually override the
taggedversion in yourstack.yaml
Open your project’sstack.yamlfile and add this line under theextra-depssection (create the section if it doesn’t exist):extra-deps: - tagged-0.8.5This tells Stack to use the compatible version of
taggedinstead of the one from your default resolver. After saving, runstack buildagain—this should resolve the immediate conflict.Update your Stackage resolver
If you’re using an older LTS or Nightly snapshot, this dependency issue might already be fixed in a newer version. Check the latest resolvers that support GHCJS, then update theresolverfield in yourstack.yaml. For example:resolver: lts-12.26 # Use a resolver known to work with GHCJS and have compatible tagged/semigroupoids versionsNote: Make sure the resolver you choose supports your Ubuntu 17.10 environment and GHCJS.
Clean up residual cache (beyond deleting
~/.stack)
Even after deleting~/.stack, sometimes project-local caches can cause issues. Run these commands to ensure a fresh build:stack clean --full stack build --force-dirtyFor the
reflex-dom-stack-demospecifically
This demo project might have its own pre-configuredstack.yaml. If the resolver there is outdated, update it to a newer one and addtagged-0.8.5to itsextra-depssection as well.
Final notes
The bug you saw on Stackage is likely exactly this dependency mismatch, and it’s usually resolved in newer snapshots. If updating the resolver or adding the extra dep doesn’t work, you might need to check if there are other conflicting dependencies (Stack will tell you which ones) and add those to extra-deps too.
内容的提问来源于stack exchange,提问作者RecencyEffect

