This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-06-17
Channels
- # announcements (4)
- # babashka (22)
- # beginners (50)
- # biff (2)
- # calva (4)
- # cider (18)
- # clj-kondo (12)
- # cljs-dev (3)
- # clojars (2)
- # clojure (66)
- # clojure-austin (1)
- # clojure-belgium (11)
- # clojure-europe (90)
- # clojure-hungary (5)
- # clojure-norway (6)
- # clojure-switzerland (1)
- # clojure-uk (4)
- # clojurescript (19)
- # datascript (2)
- # datomic (41)
- # fulcro (4)
- # gratitude (2)
- # helix (20)
- # jackdaw (2)
- # jobs (9)
- # jobs-discuss (38)
- # kaocha (1)
- # minecraft (8)
- # off-topic (11)
- # polylith (21)
- # rdf (2)
- # remote-jobs (1)
- # sci (1)
- # shadow-cljs (12)
- # specter (7)
- # tools-deps (16)
I recently upgraded from shadow 2.15.12 to 2.19.3. I've been trying to generate reports and I'm still seeing it trying to use the 2.15.12 version. At first I figured it was my cache, but I've dumped node_modules, I've switched npm versions, and everything still ends up using 2.15.12. I started to wonder, is there something up with the reporter? Or is it some hidden cache thing I've yet to clear out? Anyone able to generate reports on a newer version that 2.15.12?
Does you deps.edn
or project.clj
refer to 2.19.3
?
Do you maybe have a running shadow-cljs process in that project's directory?
Yep, it was the deps.edn
, completely blanked it as my shadow builds were using 2.19.3 as expected. Thanks!
I can invoke fine with (js/window.history.go -1)
but it throws Illegal invocation error if I invoke with (def a (partial js/window.history.go -1))
and then (a)
I see, you were say bind
like this let f = document.getElementsByTagName.bind(document)
Trying to use this example as a receipt for requiring an npm module https://clojurescript.org/news/2017-07-12-clojurescript-is-not-an-island-integrating-node-modules. The REPL starts and the page is rendered, but I get errors about some @cljs-oss/module
:
% clj -M --main cljs.main --compile converter.core --repl
node:internal/modules/cjs/loader:942
throw err;
^
Error: Cannot find module '@cljs-oss/module-deps'
Require stack:
- /Users/pez/Projects/DartClojure/npm-example-app/[eval]
at Module._resolveFilename (node:internal/modules/cjs/loader:939:15)
at Module._load (node:internal/modules/cjs/loader:780:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at [eval]:8:13
at Script.runInThisContext (node:vm:129:12)
at Object.runInThisContext (node:vm:305:38)
at node:internal/process/execution:76:19
at [eval]-wrapper:6:22
at evalScript (node:internal/process/execution:75:60) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/Users/pez/Projects/DartClojure/npm-example-app/[eval]' ]
}
Node.js v18.0.0
ClojureScript 1.11.54
cljs.user=>
I the tried with npm install @cljs-oss/module
, giving me another error:
% clj -M --main cljs.main --compile converter.core --repl
node:events:505
throw er; // Unhandled 'error' event
^
Error: Parsing file /Users/pez/Projects/DartClojure/npm-example-app/node_modules/dartclojure/target/node-lib/index.js: Unterminated string constant (825:23)
at Deps.parseDeps (/Users/pez/Projects/DartClojure/npm-example-app/node_modules/@cljs-oss/module-deps/index.js:483:28)
at getDeps (/Users/pez/Projects/DartClojure/npm-example-app/node_modules/@cljs-oss/module-deps/index.js:415:40)
at /Users/pez/Projects/DartClojure/npm-example-app/node_modules/@cljs-oss/module-deps/index.js:399:32
at ConcatStream.<anonymous> (/Users/pez/Projects/DartClojure/npm-example-app/node_modules/concat-stream/index.js:36:43)
at ConcatStream.emit (node:events:539:35)
at finishMaybe (/Users/pez/Projects/DartClojure/npm-example-app/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:475:14)
at endWritable (/Users/pez/Projects/DartClojure/npm-example-app/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:485:3)
at Writable.end (/Users/pez/Projects/DartClojure/npm-example-app/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:455:41)
at DestroyableTransform.onend (/Users/pez/Projects/DartClojure/npm-example-app/node_modules/readable-stream/lib/_stream_readable.js:577:10)
at Object.onceWrapper (node:events:641:28)
Emitted 'error' event on Deps instance at:
at Deps.parseDeps (/Users/pez/Projects/DartClojure/npm-example-app/node_modules/@cljs-oss/module-deps/index.js:483:14)
at getDeps (/Users/pez/Projects/DartClojure/npm-example-app/node_modules/@cljs-oss/module-deps/index.js:415:40)
[... lines matching original stack trace ...]
at Object.onceWrapper (node:events:641:28)
Node.js v18.0.0
ClojureScript 1.11.54
cljs.user=>
Not sure what to make of it. Also not sure if it matters that the module I am trying to us is local, living in the parent dir, installed with npm i ..
.This is the old way where you process stuff through Closure it generally does not work
This turned out to be a configuration error of mine in the npm package I am building. It now works. Still curious about how a minimal ClojureScript app using an npm module should be built these days.
Spoke too early. Ran up against a new stumbling block, and never got this to work. I eventually used shadow-cljs instead,
@U0ETXRFEW did you ever get this resolved? i’m running into it too with a local module, and hesitate to jump to shadow just yet
i'm getting the warning: datascript.db/equiv-datom declared arglists ([a b]) mismatch defined arglists ([d o])
but i don't understand what it's telling me what. i see that [a b] is different then [d o] but where are they coming from? the error shows me this:
198 | (defn- equiv-datom [^Datom d ^Datom o]
199 | (and (= (.-e d) (.-e o))
200 | (= (.-a d) (.-a o))
201 | (= (.-v d) (.-v o))))
202 |
so that's [d o] do where is [a b] that there can be a mismatch? like how are they being "matched"?i'm guessing the practical answer is that i should try updating datascript...
updating datascript does remove the warnings.