This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-07-12
Channels
- # announcements (1)
- # babashka (8)
- # beginners (40)
- # biff (2)
- # calva (7)
- # cider (3)
- # clerk (16)
- # clojure (6)
- # clojure-europe (24)
- # clojure-madison (5)
- # clojure-nl (2)
- # clojure-norway (17)
- # clojure-uk (17)
- # clojurescript (4)
- # cursive (4)
- # datascript (17)
- # emacs (28)
- # gratitude (1)
- # humbleui (5)
- # hyperfiddle (25)
- # jobs (5)
- # lsp (3)
- # missionary (5)
- # pedestal (7)
- # polylith (7)
- # shadow-cljs (42)
- # squint (12)
- # tools-deps (9)
I have an issue when I try to compile my code which requires a js file:
In dev it all works fine: #?(:cljs ["/brian/formats/dividerBlot" :as dividerBlot])
but when I run: clojure -M:shadow-cljs release main
I get:
[:main] Compiling ...
The required JS dependency "/brian/formats/dividerBlot" is not available, it was required by "brian/ui/rendering/text_field.cljc".
Dependency Trace:
brian/client.cljs
brian/model/session.cljs
brian/ui_components/data_privacy.cljc
brian/ui/rendering/text_field.cljc
the file is in src/js/brian/formats/dividerBlot.js
my deps.edn: {:paths ["resources" "src/gen" "src/js" "src/main"] ...}
looks fine. there is no difference in how these are looked up, so no clue what would cause this
except maybe that the trace is brian/client.cljs
. yet you pasted a snippet with a reader conditional, which are only valid in .cljc
files?
maybe there is an extra client.cljc somewhere that only included by another deps.edn alias?
could it be source-paths vs deps.edn path?
in my shadow-cljs.edn I have:
{:deps {:aliases [:dev :rad-dev]}...}
yep, then :source-paths
or :dependencies
have zero effect and are not used when using the shadow-cljs
command
but since that specifies other aliases I suspect there is just a difference in those aliases and the paths it constructs
could be the :shadow-cljs
alias has a :replace-paths
? anything that would remove the default :paths
really?
there was a :paths ["src/main"]
while investigating I read that these js files are going to go through advanced compilation?
It contains this:
import Quill from 'quill';
const BlockEmbed = Quill.import('blots/block/embed');
class DividerBlot extends BlockEmbed {
static blotName = 'divider';
static tagName = 'hr';
}
Quill.register(DividerBlot);
I know little about how these js details, I only did this because it seemed almost impossible to convert this to clojurescript(ns foo.bar
(:require
[shadow.cljs.modern :refer (defclass)]
["quill$default" :as Quill]))
(def BlockEmbed (Quill/import "blots/block/embed"))
(defclass DividerBlot
(extends BlockEmbed)
(constructor [this]
(super)))
(set! DividerBlot -blotName "divider")
(set! DividerBlot -tagName "hr")
(Quill/register DividerBlot)
currently constructor is required, so if it has different arity you'd need to provide that
I actually tried this after finding defclass with some research but it didn't work
Hello @thheller, something strange is happening when I include this into deps.edn
.
com.google.protobuf/protobuf-java {:mvn/version "4.27.2"}
.
--- SHADOW-CLJS FAILED TO LOAD! ----------------------
This is most commonly caused by a dependency conflict.
When using deps.edn or project.clj you must ensure that all
required dependencies are provided with the correct version.
You are using shadow-cljs version: 2.28.10
The important dependencies are:
org.clojure/clojure "1.11.1"
org.clojure/clojurescript "1.11.132"
com.google.javascript/closure-compiler-unshaded "v20240317"
Please verify that you are loading these versions.
You can find all required dependencies here:
Please refer to the Guide for more information:
-----------------------------------------------------
The error encountered was:
Unexpected error macroexpanding proxy at (shadow/build/data.clj:83:3).
nothing strange about it. the closure compiler depends on protobuf v3 and is not compatible with v4
Hello, anyone managed to use the latest vega-lite 5.18.1 library? I can use the library until 5.15 but after that, I have a parsing failure from shadow-cljs
Thanks. Any possible solution?
Which syntax might that be?
I see a #modified as a variable name
I guess I can try to recompile with ES6 as target
And not ES2020
thats not relevant. there is no fix, as it fails to parse the file and cannot process it any further.
only option is to either not use that package or switch to use a different tool for JS processing, see https://shadow-cljs.github.io/docs/UsersGuide.html#js-provider-external
Thank you!