Hi all, I got an error like
[2020-10-17 01:50:37.230 - INFO] :shadow.build.npm/js-invalid-requires - {:resource-name "node_modules/@aws-amplify/ui-components/dist/cjs/index-1f3b9bdc.js", :requires [{:line 1630, :column 33}]}
It looks like it is caused by
return Promise.resolve().then(function () {
return _interopNamespace(require(`./${bundleId}.entry.js${ ''}`)); }).then(importedModule => {...}, consoleError);
Is there a way to get around this in shadow-cljs?
@hjfirst no, this is not supported.
Thanks for clarifying.
Has anyone tried Cordova with Android platform? I followed this repo https://github.com/thheller/cordova-cljs but I get the Shadow-cljs - reconnecting
message. it's noted in the repo that this was only tested on the windows platform, but maybe someone has an idea? (I also removed the Content-Security-Policy
part)
does it say why the connection failed?
Sorry was afk for a bit. I got the debugger working and had the error ERR_CLEARTEXT_NOT_PERMITTED
. I then added a rule in my config.xml to fix this. Now I have an ERR_CONNECTION_REFUSED
error. Checking now if I need to add any extra rules or something.
If I can get this to work I'll create a PR to update the README for that repo
All right, figured it out. Apparently Android needs to look at 10.0.2.2
. So the solution is to add this to your shadow-cljs.edn
devtools config: :devtools-url "<http://10.0.2.2:9630>"
PR to add this info to cordova-cljs
repo, so other people don't have to bump their heads against the wall: https://github.com/thheller/cordova-cljs/pull/2
If I want to use a single, local JS file (not from npm) from CLJS, how do I do that? There is :foreign-libs
, but it sounds like that is not compatible with shadow-cljs.
@mail985 see https://shadow-cljs.github.io/docs/UsersGuide.html#classpath-js
Perfect, thanks @thheller!
should npx shadow-cljs server
produce a .nrepl-port
file?
no
it produces .shadow-cljs/nrepl.port
got it, thanks @thheller. i'm just working on an easy Cursive setup, and the "Use port from nREPL file" isn't working. i probably botched something on my end.
should be working fine assuming you have a current cursive version
older versions only looked for .nrepl-port
newer versions definitely support .shadow-cljs/nrepl.port
yup, that did the trick 🙂
and one last non-pressing thing (i'm sure i'll find it in the docs after asking)
(ns app
(:require ["left-pad" :as left-pad]))
; Cursive loading the app.cljs ns in the repl:
Loading src/main/app.cljs...
Syntax error macroexpanding clojure.core/ns at (src/main/app.cljs:1:1).
((:require ["left-pad" :as left-pad])) - failed: Extra input spec: :clojure.core.specs.alpha/ns-form
ah, shadow/repl
wasn't running. as always, thanks for your help