Fork me on GitHub

It seems to work with :npm-deps in dev.cljs.edn but it should be able to use package.json right?


Figured it out. The figwheel-main spec indicates that npm-deps has to be a map or false.


Thanks, I was trying to find this again but was having trouble. I think the nuance I got confused by is your use of webpack, for nodejs scripts it’s :npm-deps or nothing.


AFAIK when you use nodejs deps you can require them directly in code without any extra additions. You don’t need webpack. I miss that part of question about nodejs app. Sorry.


No worries. I appreciate the help, it just took a bit for it to finally click as I was confused myself. I was convinced I could keep my deps only in package.json and just use them in cljs but both fighwheel-main and lein-figwheel require the :npm-deps map to use them.


hmm I though it can be only in package.json too for nodejs


but I didn’t do any nodejs app with figwheel-main, so I don’t know


I tried it, I couldn’t get it to work and the spec of figwheel says npm-deps can only be false or a map of deps. The cljs docs state that if npm-deps is false it completely ignores node_modules anticipating bundling to happen from webpack or something. It’s possible I am misconfiguring it but signs are pointing to an :npm-deps requirement. Worst case I can release a working version when it’s ready and someone can correct me 🙂


I am sure bhauman can easy answer you for this question.


He is from time to time here


Would you recommend raising an issue on figwheel-main?


Hmm I think it is issue about documentation at the first place then


because there is no clear answer from what you are saying


personally I don’t know what is an answer


I found the answer from bhauman from the past to me:


bhauman [3:14 PM]
@kwladyka figwheel always needs to start a server for its websocket connection

all you need is `:target :nodejs`
Not sure about Cursive
You shouldn't have to use :npm {:bundles} when you use nodejs (edited) 
You can and should  use `js/require` directly
`:npm-deps true` will in many cases allow you to require node modules in `ns` forms


ha I think it solves your issue


I saved this precious advice for the future like now 🙂


Hah interesting. I see, I am using ns forms which I think is important to this project. I’m going to make a PR to update the docs to explain that and perhaps write a small article. Thanks so much! Do you have an email, website, or org I can credit?

👍 5

Heh only my simple web page which I made years ago 🙂


But don’t worry. I am happy I could help you.


Clojure community is great, so I am trying to give back what I got 🙂


I completely agree with you 🙂