ClojureScript

Relative paths are incorrect when source map isn't in same directory as project.clj

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    CLJS 2030
  • Patch:
    Code

Description

For example:

(defproject sandbox "0.1.0"
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [org.clojure/clojurescript "0.0-2030"]]

  :plugins [[lein-cljsbuild "1.0.0-alpha2"]]

  :source-paths ["src"]

  :cljsbuild { :builds [{:id "sandbox"
                         :source-paths ["src"]
                         :compiler { :output-to "dist/main.js"
                                     :output-dir "dist/out"
                                     :optimizations :advanced
                                     :source-map "dist/main.js.map"}}]})

Chrome looks for dist/dist/out/foo.cljs instead of dist/out/foo.cljs
You can manually fix it by opening dist/main.map.js and changing all the dist/out to out.
I think the general solution is that all the paths must be relative to the parent of :source-map

See: https://github.com/fivetran/cljs-source-maps-incorrect-paths

Potentially related to http://dev.clojure.org/jira/browse/CLJS-591

Activity

People

Vote (0)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: