You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Haskell Stack依赖损坏问题求助:GHCJS构建失败

Fixing GHCJS Dependency Conflict with 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 tagged version in your stack.yaml
    Open your project’s stack.yaml file and add this line under the extra-deps section (create the section if it doesn’t exist):

    extra-deps:
      - tagged-0.8.5
    

    This tells Stack to use the compatible version of tagged instead of the one from your default resolver. After saving, run stack build again—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 the resolver field in your stack.yaml. For example:

    resolver: lts-12.26  # Use a resolver known to work with GHCJS and have compatible tagged/semigroupoids versions
    

    Note: 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-dirty
    
  • For the reflex-dom-stack-demo specifically
    This demo project might have its own pre-configured stack.yaml. If the resolver there is outdated, update it to a newer one and add tagged-0.8.5 to its extra-deps section 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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 08:42:52