ClojureScript

Source maps break user-defined javascript namespaces

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

Description

With source maps on, user-defined javascript modules are broken:

project.clj:

(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 { :libs ["src/bar.js"]
                                     :output-to "main.js"
                                     :output-dir "out"
                                     :optimizations :advanced
                                     :source-map "main.js.map"}}]})

foo.cljs:

(ns foo
  (:require bar))

(defn ^:export fooFunction []
  (bar/barFunction))

bar.js:

goog.provide("bar");

var bar = {};

bar.barFunction = function() {
  return "barResult";
};

goog.exportSymbol("bar.barFunction", bar.barFunction);

Compilation throws the error:

No implementation of method: :make-reader of protocol: #'clojure.java.io/IOFactory found for class: nil

Deleting one line from project.clj fixes it:

:source-map "main.js.map"

See https://github.com/fivetran/cljs-source-map-breaks-js

Activity

David Nolen made changes -
Field Original Value New Value
Assignee David Nolen [ dnolen ]
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 (1)

Dates

  • Created:
    Updated:
    Resolved: