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

Tim Visher made changes -
Field Original Value New Value
Attachment fix-674.patch [ 12464 ]
Tim Visher made changes -
Patch Code [ 10001 ]
Tim Visher made changes -
Attachment fix-674.patch [ 12466 ]
Tim Visher made changes -
Attachment fix-674.patch [ 12464 ]
Tim Visher made changes -
Attachment fix-674-follow-assumptions-about-nature-of-output-dir-output-to-source-map.patch [ 12468 ]
Tim Visher made changes -
Attachment fix-674-follow-assumptions-about-nature-of-output-dir-output-to-source-map.patch [ 12468 ]
Tim Visher made changes -
Attachment fix-674.patch [ 12466 ]
Tim Visher made changes -
Attachment fix-674.patch [ 12469 ]
Tim Visher made changes -
Attachment fix-674.patch [ 12470 ]
Tim Visher made changes -
Attachment fix-674.patch [ 12469 ]
Tim Visher made changes -
Attachment fix-674.patch [ 12471 ]
Tim Visher made changes -
Attachment fix-674.patch [ 12470 ]
Tim Visher made changes -
Attachment fix-674.patch [ 12472 ]
Tim Visher made changes -
Attachment fix-674.patch [ 12471 ]
Tim Visher made changes -
Attachment fix-674.patch [ 12473 ]
Tim Visher made changes -
Attachment fix-674.patch [ 12472 ]
David Nolen made changes -
Resolution Completed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
David Nolen made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: