This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-29
Channels
- # announcements (5)
- # beginners (25)
- # calva (53)
- # clj-kondo (9)
- # clojure (25)
- # clojure-europe (14)
- # clojure-nl (1)
- # clojure-norway (21)
- # clojure-uk (1)
- # conjure (2)
- # data-science (1)
- # datalevin (4)
- # datascript (6)
- # deps-new (5)
- # emacs (5)
- # etaoin (6)
- # figwheel-main (1)
- # fulcro (46)
- # gratitude (3)
- # hyperfiddle (8)
- # introduce-yourself (13)
- # lsp (13)
- # nextjournal (5)
- # off-topic (2)
- # pathom (4)
- # polylith (11)
- # re-frame (16)
- # releases (4)
- # scittle (67)
- # shadow-cljs (38)
- # slack-help (4)
- # specter (13)
- # sql (29)
- # squint (21)
- # test-check (3)
- # vim (13)
- # xtdb (15)
Hi, I have a deps.edn/figwheel-main re-frame project that I'm trying to add re-frame-10x
to. The deps.edn (day8.re-frame/re-frame-10x {:mvn/version "1.5.0"}) and dev.cjls.edn (:preloads [day8.re-frame-10x.preload]) seem correct and the project builds without errors. When the web app is started though, I get this error:
Uncaught Error: Bad dependency path or symbol: highlight.js.lib.core
Any ideas on a solution?
@robert.nadler I'd use re-frame-template
to create a new project, and include re-frame-10x. That will give you a working project to compare against.
Also, if your project has an explicit dependency on highlight.js, then ensure you are using a version compatible with that used internally by re-frame-10x ...which is just say a recent version
The re-frame-template builds a shadow-cljs
project. I've already tried to use shadow-cljs with :deps true
to pick up the deps.edn dependencies.
That path has led to other build dependency failures (specifically "cljsjs.husl").
The code base I'm working with is rather large and I'm trying to avoid going down too many rabbit holes...
From the sounds of your problem, I'd just be looking at the deps
Does your project have an explicit dependency on highlight.js ?
I think I've solved this in past by adding highlight to package.json. could be shadow :deps true causes this
I have the correct version of highlight.js in package.json. I don't think deps.edn builds include npm libs though.
@robert.nadler the error is coming from here - https://github.com/superstructor/re-highlight/blob/master/src/re_highlight/core.cljs And I suspect is related to figwheel not supporting the same npm require forms as shadow-cljs.
Having the same problem. Using figwheel-main. tried adding highlight manually with yarn and it doesn't help
No such namespace: highlight.js/lib/core, could not locate highlight/js_SLASH_lib_SLASH_core.cljs, highlight/js_SLASH_lib_SLASH_core.cljc, or JavaScript source providing "highlight.js/lib/core" (Please check that namespaces with dashes use underscores in the ClojureScript file name) in file target/public/cljs-out/dev/re_highlight/core.cljs
1 (ns re-highlight.core
2 (:require
3 [goog.object :as gobj]
4 [reagent.core :as r]
5 [reagent.dom :as rdom]
6 ["highlight.js/lib/core" :as hljs]
^---
7 ["highlight.js/lib/languages/clojure" :as clojure]))
8
9 (def hljs-highlight-element (gobj/get hljs "highlightElement"))
10 (def ^:private hljs-init-highlighting (gobj/get hljs "initHighlighting"))
11 (def hljs-register-language (gobj/get hljs "registerLanguage"))
I don't use figwheel so if someone who does use it has a known fix to suggest or submit a PR for I'm happy to apply it.
@robert.nadler Any success ?
@U0G75S29H Thanks for the help. This is a side project, so not sure when I'll be able to get to it. Will let you know though. Damned day job! 🙂
Not pretty, but finally solved it: https://bobonmedicaldevicesoftware.com/blog/2022/10/02/dealing-with-clojurescript-cross-build-npm-dependencies/ Feedback welcome.