This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-05
Channels
- # announcements (4)
- # beginners (21)
- # calva (3)
- # clj-http (3)
- # clj-kondo (10)
- # clojars (5)
- # clojure (4)
- # clojure-europe (5)
- # clojurescript (71)
- # datomic (3)
- # fulcro (18)
- # helix (5)
- # introduce-yourself (2)
- # missionary (1)
- # off-topic (19)
- # polylith (21)
- # reagent (3)
- # shadow-cljs (28)
- # tools-deps (6)
- # xtdb (30)
error: Uncaught ReferenceError: document is not defined
return goog.dom.createElement_(document, name);
^
at Object.goog.dom.createElement
is there any ways to prevent this error during development with :esm
target? I'm consuming the output in Deno.serveHttp
so document isn't a thing there.
compile/release works fine, I guess it's due to dev mode always has :none
optimization hence dom methods still there@gnhuy91 you need to set :runtime :custom
in your build config. otherwise defaults to :browser
which will attempt to use the dom. not related to :none
in any way
@gnhuy91, why are you investing so much energy in a deno
which doesn't work with cljs very well?
I'm generally rooting for deno
, but rather because I like it conceptually, however, I currently can't find a reason to want to use it.
for hot reload I don't use client-side build so I don't know, but deno does reload on file changes
yea correct, conceptually esm & deno will led the js platform toward a more stable future
but then you could write a small shim (maybe using :init-fn
) to run stand-alone with shadow-cljs, then consume the exports in deno
js ecosystem is slowly moving to esm format, which currently break a bunch of lib users, thus esm version is a major release for most
The :esm
target works for deno, this is why thheller specifically created it, but I'm also using it for #nbb (scripting on Node using SCI) to be able to import ES modules and this target also supports code splitting which allows nbb to lazily load code for better startup
I tried using nbb as a library from electron, I couldn't get this working, since electron is still all about commonJS and importing ES modules from commonJS isn't possible
they shouldn't have delayed this for so long in the way babel/webpack did. thats the real issue, we could have been done with this for years now 😛
Hi, I have problem adjusted to shadow-cljs env variables As the https://shadow-cljs.github.io/docs/UsersGuide.html#shadow-env "not clearly" says I can read a variable via `#shadow/env "TWITCH_AUTHORIZATION_TOKEN"` but instead i get an error `No reader function for tag shadow/env.` my version of shadow-cljs is "2.15.2" here is my shadow-cljs.edn:
{:source-paths
["src/main"]
:dependencies
[[reagent "1.1.0"]
[cljs-ajax "0.8.4"]]
:dev-http {8080 "public"}
:builds
{:frontend
{:target :browser
:modules {:main {:init-fn app/start}}
:closure-defines {events.async/TWITCH_AUTHORIZATION_TOKEN #shadow/env "TWITCH_AUTHORIZATION_TOKEN"}}}}
also my .env:
TWITCH_AUTHORIZATION_TOKEN="blalbbllba"
so my question is how to read a env variable then?