This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-18
Channels
- # adventofcode (20)
- # aleph (25)
- # announcements (4)
- # babashka (117)
- # beginners (150)
- # calva (4)
- # cider (9)
- # clj-on-windows (2)
- # clojure (9)
- # clojure-europe (4)
- # clojure-italy (3)
- # clojuredesign-podcast (18)
- # clojurescript (16)
- # conjure (1)
- # core-async (35)
- # cursive (13)
- # datalevin (6)
- # datomic (6)
- # fulcro (8)
- # hyperfiddle (5)
- # malli (8)
- # nextjournal (4)
- # off-topic (51)
- # pathom (4)
- # reagent (21)
- # sci (14)
- # shadow-cljs (22)
- # specter (3)
- # testing (22)
- # tools-deps (8)
- # xtdb (7)
Hi guys, my dev
build works fine (and I don't see the error below) but my release
build gives me this error
Uncaught TypeError: g[b].bind is not a function
at app.js:formatted:85780
at Array.forEach (<anonymous>)
at app.js:formatted:85779
at Array.forEach (<anonymous>)
at Object.shadow$provide.<computed> (app.js:formatted:85778)
at BS (app.js:formatted:214122)
at Object.shadow$provide.<computed> (app.js:formatted:85822)
at BS (app.js:formatted:214122)
at Object.shadow$provide.<computed> (app.js:formatted:85952)
at BS (app.js:formatted:214122)
Steps to diagnose why/make it easier to debug this?The term you are looking for is "externs". It is likely you are missing some. It should help to run shadow-cljs release the-build --pseudo-names
or shadow-cljs release the-build --debug
In short some property is getting renamed but the g[b]
suggests you are trying to access the property by its string value which then accesses a non existent property since it was renamed
Thanks @U05224H0W! I'm reading through https://shadow-cljs.github.io/docs/UsersGuide.html
Release debugging commands.
$ shadow-cljs check app
$ shadow-cljs release app --debug
So where do I start looking after I've built with the --debug
flag?Ah I see
shadow$provide[1322] = function(global,require,module,exports) {
var DomUtils = module.exports;
[
require("./lib/stringify"),
require("./lib/traversal"),
require("./lib/manipulation"),
require("./lib/querying"),
require("./lib/legacy"),
require("./lib/helpers")
].forEach(function(ext){
Object.keys(ext).forEach(function(key){
DomUtils[key] = ext[key].bind(DomUtils);
});
});
};
hmm so this happens somewhere in npm code. kinda unsure what to do then. it is definitely externs related but finding which externs you need exactly is kinda tricky like that
Here's my project.clj
, node version is 16.13.1
, I can give out other details if necessary
What are some commonly used libraries /examples of writing a string to a new pdf file using ClojureScript or NodeJs? I've come across the npm package pdfkit, but was wondering if there is a way to do just using the npm library ‘fs’ and .writeFile function, without bringing in another dependency.
As a follow up, once I have a file written to the file system, how do I download/send that file as a response to a Cloud function request?
Essentially, I have a json file in Cloud Storage. I can download it using the sdk to the server file system, and after running some transformations on it, I would now like to write it to a pdf file, and then send that pdf file as a response to the client as part of the Firebase / Cloud Function response.
https://github.com/babashka/nbb/blob/main/examples/react-pdf/example.cljs this seems pretty nice
just like on-change and on-click events does clojurescript supports on-mousedown and on-mouseup event ?
Those events have nothing to do with CLJS. If something can be done in JS, it can be done one way or another in CLJS. What matters more is what UI libraries/frameworks you're using, if any. But chances are, those events are supported as well.
Thanks I want to ask another question that in JS we write on-change and on-click function like {()=> console.log("Event Happened")}
what is equivalent of it in CLJS ?
() => ...
is JS syntax to create a nameless function, a lambda. {...}
around it are probably for React, to let it know that the thing inside is a JS value (or something like that, I'm not a React dev).
So you just have to create a regular CLJS function, that's it. Like #(...)
or (fn [] ...)
.
Thank you that is helpful