This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-08-06
Channels
- # announcements (4)
- # beginners (132)
- # calva (37)
- # chlorine-clover (60)
- # cider (1)
- # clara (12)
- # clj-kondo (40)
- # cljs-dev (109)
- # clojure (76)
- # clojure-dev (19)
- # clojure-europe (8)
- # clojure-france (17)
- # clojure-nl (4)
- # clojure-sg (1)
- # clojure-spec (14)
- # clojure-uk (7)
- # clojurescript (98)
- # conjure (96)
- # cursive (15)
- # data-science (2)
- # datalog (11)
- # datomic (24)
- # emacs (17)
- # figwheel-main (3)
- # fulcro (45)
- # jobs-discuss (1)
- # kaocha (3)
- # malli (2)
- # nrepl (1)
- # off-topic (135)
- # portal (2)
- # re-frame (17)
- # reagent (11)
- # reitit (4)
- # sci (60)
- # shadow-cljs (75)
- # spacemacs (3)
- # sql (32)
- # tools-deps (79)
- # vim (88)
- # xtdb (4)
Hey @thheller running into some weirdness with when trying to import a javascript file that itself has an import and CLJS is throwing back at me saying that Requested module does not have an export "initSchema".
(ns ex
(:require ["@aws-amplify/datastore" :refer [DataStore initSchema] :as foo]
#_["/models/index" :refer [Post]]
[cljs.core.async.interop :refer [<p!]]))
works just fine and initSchema
is a fn if I log itFinal point is that if I swap to import * as foo from '@aws-amplify/datastore';
everything works and I can use foo
but unfortunately this is generated code and would rather not have to update the require after each time I re-generate the file
Is it a known issue that when evaling stuff with nRepl, I've started to get
[2020-08-06 07:06:52.100 - WARNING] :shadow.cljs.devtools.server.util/handle-ex - {:msg {:op :cljs-load-sources, :sources [[:shadow.build.classpath/resource "cljs/repl.cljs"] [:shadow.cljs.repl/resource "cljs/user.cljs"]], :call-id 6, :from 21}}
ExceptionInfo no output for id: [:shadow.cljs.repl/resource "cljs/user.cljs"] {:resource-id [:shadow.cljs.repl/resource "cljs/user.cljs"]}
pretty frequently, and the only solution that I've found is to shut down shadow-cljs and start it again. I haven't figured out the actual circumstances this happens but I'll try to see if I see some similarities. I'm using Vim/Fireplace if that is something that might have to do with this.@thheller how do i interpret the size difference between what the build report says, and the filesize on disk? for example, a common module, the report says "JS: 1.92 MB", but on disk, the same module is '9912095' bytes, or 10mb. is it perhaps that the report is about :release and my on-disk code is the non-:release version? edit: on reflection, this is a silly question, of course it's about the :release version π
@royalaid npm
packages are imported in a separate step and converted to commonjs. closure does some strict checking for ESM files but since everything is CJS it only supports imports * as ...
. a bit annoying but pure ESM doesn't work unless everything is ESM and npm
packages rarely are.
@robert-stuttaford yeah, its always release
@mikko which version do you use? I thought I fixed that issue a couple versions ago?
shadow-cljs - server version: 2.10.19 running at
I think this relates to running code in a completely new NS, or then something else has failed in prior reload and then evaluating new code causes this. But these are just pure guesses.
very strange. would help a lot if you can narrow it down a create some reproducible steps to trigger it.
Definitely. Will try!
I think this has to do with clara.rules
somehow. I'm not sure why, but it seems that whenever I get into a state where it fails to satisfy our constraints we get to an error state where I evaluate a form, and then it prints that error. We've had had issues with clara.rules previously too on CLJS that it might do something funky, might be related to compilation failing or something..
For instance, now I just hit a situation where it failed to succeed with a perfectly valid set of facts and rules, that error appeared, restarted the compilation and now it works with no changes π
strange. no clue how that may be happening. thought I fixed all the cases but I guess not?
What was the relevant part you changed? If I could spot something⦠(or not)?
what do you mean? the commit that should have fixed this was https://github.com/thheller/shadow-cljs/commit/80d56a807af3b7a921f10b858e38ff20f4de9bfe
Can it be that the connection tries to declare cljs.user
again and that itself causes an exception causing the cljs,user
to not be available anymore?
For example, (ns cljs.user (:require some.namespace.that.fails))
Hey, that's it? If I just put (throw (js/Error. "Lets fail"))
to a NS and then load it => I get that error!
First.
[2020-08-07 12:45:14.376 - WARNING] :shadow.cljs.devtools.server.worker.impl/cljs-compile-ex - {:input {:code "(load-file \"filippos/core/models/data_types.cljs\")", :ns cljs.user, :repl true}}
ExceptionInfo Failed to process REPL command {:eof? false, :ns cljs.user, :form (load-file "filippos/core/models/data_types.cljs"), :source "(load-file \"filippos/core/models/data_types.cljs\")", :tag :shadow.cljs.repl/process-ex}
(that data_types ns has the throw)
Then next eval form:
[2020-08-07 12:45:47.721 - WARNING] :shadow.cljs.devtools.server.util/handle-ex - {:msg {:op :cljs-load-sources, :sources [[:shadow.build.classpath/resource "cljs/repl.cljs"] [:shadow.cljs.repl/resource "cljs/user.cljs"]], :call-id 8, :from 40}}
ExceptionInfo no output for id: [:shadow.cljs.repl/resource "cljs/user.cljs"] {:resource-id [:shadow.cljs.repl/resource "cljs/user.cljs"]}
And I load it with Require!
in fireplace after I planted that throw
> [2020-08-07 12:45:14.376 - WARNING] :shadow.cljs.devtools.server.worker.impl/cljs-compile-ex
Whoops
Yeah, and that is on the classpath.
yes but load-file
expects a file-path so src/main/filippos/core/models/data_types.cljs
or an absolute path
I mean this error should clearly not cause everything else to fail but it is a legit error caused by sending invalid data
wait, I'll add repro steps
Argh. I thought I had it but now it's resisting me and is working π
I'll try.
1. compile 2. introduce error in code & save 3. wait for compilation 3. refresh browser 4. eval anything in that NS => fails subsequently, even after fixing the error and refreshing
sorry that isn't precise enough. like I said a JS (throw ...)
cannot possibly cause an error on the compiler side
OK β so basically it boils down to having unhandled exceptions lurking around in the core and that causes failures?
so we need to track down what you did to trigger that error, not the other errors that may cause.
Understood.
With the minimal setup as described here: https://github.com/minimal-xyz/minimal-shadow-cljs-browser. Is it supposed to deploy, ie. copy assets like index.html when it detects changes?
Cool, what magic incantation makes it do so? May be this https://shadow-cljs.github.io/docs/UsersGuide.html#_css_reloading
Thanks. I am new to cljs, at the stage of examining the tools around it. I assumed it will reload when it sees a change in asset files, like figwheel is doing.
css reloading yes that is supported but assumes that you put it into the correct place yourself