This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-29
Channels
- # beginners (18)
- # boot (1)
- # cider (12)
- # clojure (18)
- # clojure-russia (5)
- # clojure-uk (8)
- # clojurescript (17)
- # cursive (7)
- # datomic (10)
- # editors (1)
- # figwheel-main (14)
- # hoplon (2)
- # hyperfiddle (1)
- # keechma (2)
- # leiningen (25)
- # off-topic (5)
- # onyx (3)
- # reagent (53)
- # reitit (6)
- # shadow-cljs (14)
- # spacemacs (3)
- # tools-deps (14)
- # uncomplicate (12)
Is there any way to use node modules that use node's builtin requires similar to the way browserify does it?
I'm trying to use a library (https://github.com/Level/levelup), but even after installing https://www.npmjs.com/package/util, it's still saying Error: module not found: "util" from file
.
I assume this is because it's not actually required by the package, so the closure compiler doesn't find it.
I suppose I could webpack/browserify the modules I need to use and use a :foreign-libs
entry? Any other ideas?
Oh, sorry. I'm trying to use them in the browser.
Yeah, I assumed the shim would be enough. I suppose I'll start down the foreign lib path.
I've narrowed it down to readable-stream
not being able to use the util
package from node_modules
.
@ghopper did you ever try shadow-cljs? it takes care of all of that. webpack/browserify use these "replacements" for the built-in node packages. https://github.com/webpack/node-libs-browser. shadow-cljs does too so they work just fine. CLJS itself does not so they don't work.
Oh, thanks, @thheller, I forgot about shadow-cljs.
@ghopper I wonder if this is a fundamentally new issue or already covered in JIRA. FWIW, I tried Closure Compiler v20180716 and it also fails in the same way.
Seems like it might be related to https://dev.clojure.org/jira/browse/CLJS-2816
Thanks for creating that, @mfikes!