We're updating the issue view to help you get more done. 

cljs.main: load file fails if NPM deps involved

Description

src/foo/core.cljs

1 2 3 4 5 (ns foo.core (:require left-pad)) (defn pad [n] (left-pad n 10 0))

We pass -d here to work around CLJS-2752 and CLJS-2666.

1 2 3 4 5 6 7 8 9 10 11 12 $ clj -m cljs.main -co '{:npm-deps {:left-pad "1.3.0"} :install-deps true}' -d out -r cljs.user=> (load-file "foo/core.cljs") nil cljs.user=> (dir foo.core) pad nil cljs.user=> (foo.core/pad 3) ReferenceError: Can't find variable: foo cljs.user=> (require 'foo.core) cljs.user=> (foo.core/pad 3) "0000000003"

Note that load-file fails (even though it can succeed; see CLJS-2753), while require succeeds.

Environment

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

Status

Assignee

Unassigned

Reporter

Mike Fikes

Labels

None

Approval

None

Patch

None

Priority

Major