This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-26
Channels
- # adventofcode (2)
- # announcements (7)
- # babashka (20)
- # beginners (77)
- # brompton (6)
- # calva (4)
- # clj-kondo (28)
- # clj-together (1)
- # cljdoc (2)
- # cljfx (10)
- # cljsrn (1)
- # clojure (77)
- # clojure-europe (33)
- # clojure-gamedev (12)
- # clojure-uk (11)
- # clojurescript (95)
- # clojureverse-ops (4)
- # core-async (4)
- # core-logic (1)
- # cryogen (2)
- # cursive (14)
- # data-science (3)
- # datomic (47)
- # duct (1)
- # emacs (7)
- # fulcro (51)
- # gratitude (8)
- # helix (14)
- # hoplon (4)
- # improve-getting-started (60)
- # jobs (1)
- # jobs-discuss (4)
- # joker (11)
- # lsp (99)
- # meander (62)
- # membrane (5)
- # news-and-articles (3)
- # off-topic (64)
- # pathom (3)
- # polylith (11)
- # practicalli (7)
- # react (1)
- # reagent (8)
- # reveal (15)
- # shadow-cljs (78)
- # specter (7)
- # sql (16)
- # tools-build (1)
- # tools-deps (29)
- # workspaces (1)
- # xtdb (17)
is there a convention or existing solution to make :dev/after-load
hooks not take effect when set in a library?
@thheller asked myself the same questions and came to the conclusion that it should not exists as part of the lib but in another dir like examples
, outside of the lib classpath
I am trying to use a javascript package (Accord Project Cicero and templatemark) that does not compile because of a pdfmake dependency - I checked and found pdfmake listed in clsjs so apparently that isn’t the problem — My error message in hopefully relevant part is:
Caused by:
RuntimeException: INTERNAL COMPILER ERROR.
Please report this problem.
Invalid node in lhs: STRINGLIT / 15252:4 [length: 15] [source_file: node_modules/pdfmake/build/pdfmake.js]
Node(GETPROP default): node_modules/pdfmake/build/pdfmake.js:15259:8
exports.default = void 0;
Parent(ASSIGN): node_modules/pdfmake/build/pdfmake.js:15259:0
exports.default = void 0;
I know this isn’t much information but I’m not a javascript guy any thoughts on this - I’ve googled without any luck
I guess there is some code in there it doesn't like. can't do much about this from shadow, this is a closure-compiler problem
I keep getting a blank screen with Uncaught Error: Assert failed: Invalid Hiccup form: [nil]
but the component is just this simple one
(defn heyson []
[:div "heyson"])
i import it like this: [app.components.cashflows :refer [graph-fn heyson]]
and it is used like this
[:<>
[input-bar app-state]
[heyson]
[json-city-list @app-state
(activate-modal app-state)]]
when i comment out the component and refresh it works again
[:<>
[input-bar app-state]
;[heyson]
[json-city-list @app-state
(activate-modal app-state)]]
If i take the same component and input into another file it works fine.
[app.components.cities.city-list :refer [json-city-list heyson]]
The error is due to this import ["@ant-design/charts" :refer (Line)]
inside the same file as the heyson
component.
The issue had been solved!
Just changed to a default import in the file where i couldn't import from.
["@ant-design/charts/es/plots/line" :default Line]
So if you experience this error and you have found my post here do this:
1. Isolate the component that is causing the Uncaught Error: Assert failed: Invalid Hiccup form: [nil]
error.
2. Go into the file where you imported this component from. Meaning the file in which you have defined the component that is causing the error.
3. Isolate which import/require is causing the trouble.
4. Try to replace it with a default import ["npmpackage/lib/component" :default Component]
5. Give this a thumbs up or down if it helped you. So that other people can now if it was useful, before they start reading 🙂
Another naive question I watched the recent David Nolan video where he talked about keeping javascript as javascript — I have some react components that contain the code I recently asked about that crashes - Can I compile the Component as javascript and not recompile it
your code doesn't cause the issue. the dependency does. you can use webpack or so to process the JS code after shadow-cljs is done with it.
@thheller I tried the suggestion from Twitter in a browser REPL:
(ns foo (:require ["goog$global.console" :refer [log]]))
That doesn't seem to work@thheller perhaps a difference in REPL vs file?
$ clj -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version "1.10.866"}}}' -M -m cljs.main
ClojureScript 1.10.866
cljs.user=> (ns foo (:require [goog$global.console :refer [log]]))
WARNING: foo is a single segment namespace at line 1 <cljs repl>
Unexpected error (ExceptionInfo) compiling at (REPL:1).
Invalid :refer, var goog$global.console/log does not exist in file <cljs repl>
foo=> (ns foo (:require [goog$global.console ]))
WARNING: foo is a single segment namespace at line 1 <cljs repl>
Execution error (ExceptionInfo) at cljs.repl/ns->input (repl.cljc:203).
goog$global.console does not exist
none of what regular CLJS does in this regard affects how shadow-cljs handles it. in shadow I have the extra restriction that strings are only allowed for JS dependencies
> not-regular-namespace JS Do you mean: always use strings for JS nss, or do you mean: there's also regular-namespace JS code?
btw, this is the convention that clj-kondo has adopted as well: use strings for JS nss, then static analysis knows what's going on, so that's in line with shadow I guess. goog.* stuff is handled separately
yeah the issue I have with js-deps-via-symbol is that it relies on some wonky detection of whats present in the node_modules
folder
with (:require ["react" :as react])
you at least tell the compiler that you intent to use JS code (and the :js-provider
will know how to provide it)
but js-provider is only a concept in shadow-cljs so I guess that is why I'm biased here
that being said .. I'm surprised goog$global.Thing
doesn't work in regular CLJS. it should but there is an open ticket specifically about "globals" so maybe thats why it doesn't work
I'll stick to the string-subset of requires for JS libs for nbb, in line with shadow, which also works well for clj-kondo.
Hello there
Should I add .shadow-cljs
to my .gitignore
?
I keep mine in there
Hello, I'm trying out Expo
with shadow-cljs
I'm connecting to my iPhone device through the QR code. It was working ok until recently. Now I'm getting errors:
Error
21:09
shadow-cljs - remote-error, Event {
"isTrusted": false,
"message": "The operation couldn't be completed. Connection refused",
}
Stack trace:
in registerError
in errorImpl
in console.error
in error
in shadow.cljs.devtools.client.shared.Runtime.prototype.shadow$cljs$devtools$client$shared$IRemote$remote_error$arity$2
in shadow$cljs$devtools$client$shared$remote_error
in shadow$cljs$devtools$client$websocket$start/socket.onerror
in dispatchEvent
in _registerEvents/this._subscriptions<
in emit
in __callFunction
in callFunctionReturnFlushedQueue/<
in __guard
in callFunctionReturnFlushedQueue
in parcelRequire<.sYUN</onmessage</<
...
Any ideas what be going on here? It was working and then, for no apparent reason, it stopped working.guessing the app can't connect back to the shadow-cljs instance? maybe your network setup changed? wlan or something?
Do I understand correctly that get-ws-relay-url
should return url with the ip address not a "localhost" in case it's running in iOS?
for react-native builds server-host will be set https://github.com/thheller/shadow-cljs/blob/ba0a02aec050c6bc8db1932916009400f99d3cce/src/main/shadow/cljs/devtools/client/env.cljs#L83
you can check the IP being used by running shadow-cljs clj-repl
and then (shadow/get-server-addr)
Is anyone using shadow-cljs with Boot? I want to make an app with a frontend and backend but I'm struggling to get these two pieces to play together properly
play together in what way? I strongly recommend keeping them separate and letting each do their thing
Hey I have problem with integrating firebase with shadow-cljs app:
shadow-cljs: #11 ready!
index.esm2017.js:985 Uncaught ReferenceError: regeneratorRuntime is not defined
at PersistentConnection.value (index.esm2017.js:985)
at eval (index.esm2017.js:979)
any ideas what could be missingadd an extra (:require ["regenerator-runtime/runtime"])
somewhere in your project. ideally before JS deps are loaded
The required JS dependency "regenerator-runtime/runtime" is not available, it was required
yeah you might need to install it first. just npm install regenerator-runtime
. for reasons I don't understand babel rewrites some code to use that package without ever adding a proper require for it
bumping feature-set also did not help, i have tried everything above es8 (es2018, es-next, etc…)
ok, now its working after install regenerator-runtime