Failure to load is-plain-object transitive npm dep

Description

The slate npm dep depends on is-plain-object but it can't be loaded. Start up a REPL with:

1 clojure -m cljs.main -co '{:npm-deps {"react" "15.5.4" "react-dom" "15.5.4" "slate" "0.33.6" "immutable" "3.8.2"} :install-deps true :repl-verbose true}' -d out -r

(Note, that in the above we are going with the default browser REPL; the problem doesn't occur if you specify -re node.)

Then, after the REPL is up and running:

1 2 3 4 5 6 7 8 9 10 11 12 13 cljs.user=> (require 'slate) load-namespace module$private$tmp$test-me$node-modules$slate$lib$slate-es , compiled: ((module$private$tmp$test-me$node-modules$slate$lib$slate-es)) goog.addDependency("../node_modules/slate/lib/slate.es.js", ['module$private$tmp$test_me$node_modules$slate$lib$slate_es'], ['module$is_plain_object', 'module$immutable', 'module$slate_dev_logger', 'module$direction', 'module$esrever', 'module$debug', 'module$lodash$isEqual', 'module$lodash$mergeWith', 'module$slate_schema_violations', 'module$lodash$pick', 'module$lodash$omit', 'module$is_empty']); goog.require('module$private$tmp$test_me$node_modules$slate$lib$slate_es'); null; "Error evaluating:" (require (quote slate)) :as "goog.require('module$private$tmp$test_me$node_modules$slate$lib$slate_es');\nnull;\n" Error: Undefined nameToPath for module$is_plain_object (out/goog/base.js:1357:26) (out/goog/base.js:1369:14) (out/goog/base.js:706:27) require (out/clojure/browser/repl.cljs:340:25)

Note that it can't load module$is_plain_object, which is specified via

1 goog.require("module$is_plain_object");

inside of out/node_modules/slate/lib/slate.es.js.

But, you can load that namespace directly:

1 2 3 4 5 6 7 cljs.user=> (require 'is-plain-object) load-namespace module$private$tmp$test-me$node-modules$is-plain-object$index , compiled: ([module$private$tmp$test-me$node-modules$isobject$index] (module$private$tmp$test-me$node-modules$is-plain-object$index)) goog.addDependency("../node_modules/isobject/index.js", ['module$private$tmp$test_me$node_modules$isobject$index'], []); goog.addDependency("../node_modules/is-plain-object/index.js", ['module$private$tmp$test_me$node_modules$is_plain_object$index'], ['module$private$tmp$test_me$node_modules$isobject$index']); goog.require('module$private$tmp$test_me$node_modules$is_plain_object$index'); null;

This appears to be the result of Closure failing to find the correct paths to the modules and simply emitting module$<symbol> instead of module$<path> for the goog.require.

Environment

{:deps {org.clojure/clojurescript {:mvn/version "1.10.238"}}}

Status

Assignee

Mike Fikes

Reporter

Mike Fikes

Labels

Approval

None

Patch

None

Priority

Major