<< 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

CLJS 2030


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


(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"}}]})


(ns foo
  (:require bar))

(defn ^:export fooFunction []



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

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 Fri Jan 19 17:22:19 CST 2018 using JIRA 4.4#649-r158309.