Hi there. I’m trying to use lein doo
do test clojurescript project which has js dependencies (amplify-js) added via webpack (following this guide https://clojurescript.org/guides/webpack). The JS dependency is working fine from the src and compiles properly with lein cljsbuild once min
but when I try to do lein doo chrome-headless test once
I’m getting an error that this dependency is not visible:
$ lein clean && lein doo chrome-headless test once [ruby-2.3.7p456]
Exception in thread "main" java.lang.RuntimeException: Unable to resolve symbol: amplify in this context, compiling:(/private/var/folders/8k/dnrtl2_514z7rqcxy6rpxd_c0000gn/T/form-init2371632374355315546.clj:1:280)
any ideas why it might happen?
my :cljbuild
section of project.clj
for both test
and min
look almost identical:
{:id "min"
:source-paths ["src/cljs"]
:compiler {:main prototype.core
:output-to "resources/public/js/compiled/app.js"
:optimizations :simple
:closure-defines {goog.DEBUG false}
:pretty-print false
:infer-externs true
:npm-deps false
:foreign-libs [{:file "dist/index_bundle.js"
:provides ["amplify" "amplify-auth" "amplify-api"]
:global-exports {amplify Amplify
amplify-auth AmplifyAuth
amplify-api AmplifyAPI}}]}}
{:id "test"
:source-paths ["src/cljs" "test/cljs"]
:compiler {:main prototype.runner
:output-to "resources/public/js/compiled/test.js"
:output-dir "resources/public/js/compiled/test/out"
:optimizations :none
:infer-externs true
:npm-deps false
:foreign-libs [{:file "dist/index_bundle.js"
:provides ["amplify" "amplify-auth" "amplify-api"]
:global-exports {amplify Amplify
amplify-auth AmplifyAuth
amplify-api AmplifyAPI}}]}}