This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-11-29
Channels
- # adventofcode (1)
- # announcements (2)
- # beginners (163)
- # biff (3)
- # calva (19)
- # cider (56)
- # cljs-dev (5)
- # clojure (43)
- # clojure-belgium (2)
- # clojure-europe (47)
- # clojure-norway (32)
- # clojure-uk (2)
- # clojurescript (24)
- # datomic (5)
- # events (1)
- # fulcro (2)
- # hoplon (11)
- # hyperfiddle (12)
- # jobs (1)
- # lsp (15)
- # malli (7)
- # music (1)
- # polylith (2)
- # re-frame (7)
- # reagent (7)
- # shadow-cljs (25)
- # specter (9)
- # squint (16)
- # xtdb (5)
I'm trying to include "react-markdown", but it includes a library with exports defined in the package.json file (https://github.com/syntax-tree/unist-util-visit-parents/blob/58e20d8366363b8b6e22d2e9c82d2ded408ecf16/package.json#L34C19-L34C19) that shadow-cljs doesn't seem to catch. I found an issue stating that this is implemented https://github.com/thheller/shadow-cljs/issues/977 Do I need to turn this feature on some how?
exports is fully supported, unless you are on an older version since it is pretty recent
The required JS dependency "unist-util-visit-parents/do-not-use-color" is not available, it was required by "node_modules/unist-util-visit/node_modules/unist-util-visit-parents/lib/index.js". Happens with the latest version of shadow-cljs
The do-not-use-color is just specified in exports of the package-file. https://github.com/syntax-tree/unist-util-visit-parents/blob/58e20d8366363b8b6e22d2e9c82d2ded408ecf16/package.json#L34C19-L34C19 I'm not familiar with how that works tbh
This happens pretty much for all react libraries that work with markdown as they all use unist-util it seems
I've tried a few. With the latest version of react-markdown, it takes in unist-util at "^5.0.0"
You are absolutely correct. It seems like a very widely used library, so I don't get how this is not a problem for ones in the JavaScript ecosystem
actually, there seems to be a problem. There are just many dependencies with almost the same name, so it was a bit hard to spot.
"unist-util-visit-parents": "^6.0.0"
is a dependency of unist-util-visit
. And unist-util-visit-parents
is where the problem occurs
unist-util-visit is at version 5.0.0, so react-markdown is effectively using that either way with ^5.0.0
npm dependency conflict resolution is basically non existent and sometimes needs a hand
so your constellation of dependencies just might end up getting the wrong version somehow
this is nothing shadow-cljs can do anything about or work around, so you have so resolve it
@U0B1SDL67 did you find a solution? seems like it's an ESM related issue?