<< Back to previous view

[CLJS-672] Source maps break user-defined javascript namespaces Created: 09/Nov/13  Updated: 18/Nov/13  Resolved: 18/Nov/13

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: George Fraser Assignee: David Nolen
Resolution: Completed Votes: 0
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



 Comments   
Comment by David Nolen [ 09/Nov/13 7:36 PM ]

Thanks for the report and minimal case will look into it.

Comment by David Nolen [ 17/Nov/13 12:47 PM ]

Can we get the full stack trace? Thanks.

Comment by David Nolen [ 18/Nov/13 8:34 AM ]

fixed, https://github.com/clojure/clojurescript/commit/34821a2595c194a9acee9b122cd331fbf495a7a8

Generated at Tue Sep 30 23:23:02 CDT 2014 using JIRA 4.4#649-r158309.