Open jaidetree opened 5 years ago
Yes your test.cljs.edn file is not correct.
You at least need to remove the :open-url param as it makes no sense in this context. I think the :open-url
is causing this to run in the Browser and thats why you are getting that error.
Hi. I have the same issue with simpler reproduction (ClojureScript script running on nodejs using built-in module).
{:paths ["src"]
:deps {org.clojure/clojurescript {:mvn/version "1.10.520"}
com.bhauman/figwheel-main {:mvn/version "0.2.3"}}}
{:main app.core
:target :nodejs}
(ns app.core
(:require
[path :as path]))
(defn -main [& args]
(println (.join path "/first" "second")))
(set! *main-cli-fn* -main)
Compiling and then running the script runs just fine:
$ clj -m figwheel.main -bo dev
$ node target/node/dev/dev-main.js
/first/second
Running script using -m
option fails on missing node module:
$ clj -m figwheel.main -co dev.cljs.edn -m app.core
2019-07-29 10:37:52.354:INFO::main: Logging initialized @8217ms to org.eclipse.jetty.util.log.StdErrLog
[Figwheel] Compiling build dev to "target/node/dev/dev-main.js"
[Figwheel] Failed to compile build dev in 1.751 seconds.
[Figwheel:WARNING] Compile Exception /var/www/html/nenadalm/contrib/figwheel-main-issues/148/src/app/core.cljs line:3 column:5
No such namespace: path, could not locate path.cljs, path.cljc, or JavaScript source providing "path" in file /var/www/html/nenadalm/contrib/figwheel-main-issues/148/src/app/core.cljs
1 (ns app.core
2 (:require
3 [path :as path]))
^---
4
5 (defn -main [& args]
6 (println (.join path "/first" "second")))
7
8 (set! *main-cli-fn* -main)
...
PROBLEM:
I am able to access core node modules in dev build but not in my tests.
REPRODUCTION:
Created https://github.com/eccentric-j/minirepro-fig-test-deps to minimally reproduce the problem
git clone git@github.com:eccentric-j/minirepro-fig-test-deps.git
cd minirepro-fig-test-deps
lein fig:build
node target/node/dev/dev-main.js
lein fig:test
EXPECTED:
ACTUAL:
Questions:
Environment:
dev.cljs.edn:
test.cljs.edn