This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-17
Channels
- # announcements (45)
- # asami (30)
- # babashka (96)
- # beginners (24)
- # calva (43)
- # chlorine-clover (3)
- # cider (10)
- # clj-kondo (45)
- # cljdoc (10)
- # cljs-dev (2)
- # clojars (5)
- # clojure (139)
- # clojure-australia (5)
- # clojure-europe (53)
- # clojure-filipino (1)
- # clojure-germany (27)
- # clojure-nl (4)
- # clojure-provo (7)
- # clojure-serbia (6)
- # clojure-spain (1)
- # clojure-uk (8)
- # clojuredesign-podcast (8)
- # clojurescript (76)
- # code-reviews (6)
- # conjure (4)
- # core-async (1)
- # cursive (73)
- # data-oriented-programming (2)
- # data-science (3)
- # deps-new (4)
- # depstar (7)
- # docker (16)
- # duct (7)
- # events (1)
- # fulcro (13)
- # girouette (1)
- # graphql (4)
- # honeysql (11)
- # jobs (2)
- # joker (1)
- # kaocha (4)
- # leiningen (5)
- # malli (11)
- # off-topic (14)
- # other-languages (1)
- # pedestal (4)
- # practicalli (1)
- # re-frame (5)
- # reagent (3)
- # releases (2)
- # remote-jobs (7)
- # shadow-cljs (12)
- # sql (24)
- # startup-in-a-month (2)
- # tools-deps (99)
- # vim (8)
- # vscode (1)
- # xtdb (28)
I have some trouble regarding source maps in combination with client-side routing in my development build: • When I access my SPA via localhost:<dev-http-port>, everything works as expected. • When I enter via localhost:<dev-http-port>/some/path/within/spa, the browser console is flooded with warnings regarding unresolvable source maps. In Chrome these warnings look like this:
DevTools failed to load SourceMap: Could not parse content for :<dev-http-port>/some/path/within/<:asset-path>/cljs-runtime/<cljs-ns>.js.map: Unexpected token < in JSON at position 0
I have looked into the generated code and reviewed the source maps v3 specification; shadow-cljs writes relative sourceMappingUrl (and sourceURL). According to the spec the browser should resolve sourceMappingURL relative to the "page's origin" for evaled code.
As it stands, the only chance I have to make this work is to pass a custom :dev-http
:handler
that strips /some/path/within from the URL before handing it to the default :handler
, correct?
Would it make sense to provide an option to have shadow-cljs create absolute URLs for sourceMappingUrl and sourceURL? This would probably only make sense with a single port :dev-http
...@rlschulte21 use an absolute :asset-path
. so "/js"
instead of "js"
or whereever you have your files
Thank you so much @U05224H0W! Prepending :asset-path
with / has lead to the creation of absolute // # sourceURL
and everything works as expected now. Thank you for debugging my configuration without me even sharing it..
Thank you for your quick response and your great work on shadow-cljs:raised_hands:
no it doesn't make sense to configure this in :dev-http
. :asset-path
is the config option that controls this.
Hi all! I'm trying to set up a cljs project but when I try to add chakra-ui I get a compile error. I tried to figure it out for about an hour but I did not get very far as I'm a newbie. I would appreciate it if a good soul would send me in the right direction. Thanks! (i added @emotion/react but that did not help)
FileNotFoundException: .shadow-cljs/builds/app/dev/shadow-js/module$node_modules$$emotion$react$isolated_hoist_non_react_statics_do_not_use_this_in_your_code$dist$emotion_react_isolated_hoist_non_react_statics_do_not_use_this_in_your_code_browser_cjs.js (File name too long)
java.io.FileOutputStream.open0 (FileOutputStream.java:-2)
java.io.FileOutputStream.open (FileOutputStream.java:298)
java.io.FileOutputStream.<init> (FileOutputStream.java:237)
java.io.FileOutputStream.<init> (FileOutputStream.java:187)
shadow.build.cache/write-file (cache.clj:24)
shadow.build.cache/write-file (cache.clj:24)
shadow.build.closure/convert-sources-simple/fn--12171/fn--12173 (closure.clj:2139)
clojure.lang.PersistentVector.reduce (PersistentVector.java:343)
clojure.core/reduce (core.clj:6827)
clojure.core/reduce (core.clj:6810)
....
unfortunately I don't have an easy fix for you. this is the first time I see such a long name
Thanks @U05224H0W! I search replaced the file name with a shorter name across the project and it works.