This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-19
Channels
- # announcements (7)
- # aws (4)
- # aws-lambda (1)
- # babashka (19)
- # beginners (60)
- # calva (9)
- # chlorine-clover (3)
- # cider (15)
- # clj-kondo (17)
- # clojure (34)
- # clojure-czech (1)
- # clojure-europe (96)
- # clojure-nl (2)
- # clojure-uk (46)
- # clojurescript (20)
- # css (4)
- # cursive (58)
- # data-science (3)
- # datascript (3)
- # datomic (42)
- # depstar (30)
- # dirac (4)
- # emacs (1)
- # etaoin (5)
- # events (1)
- # figwheel-main (30)
- # fulcro (6)
- # helix (9)
- # jobs (1)
- # lumo (3)
- # malli (27)
- # off-topic (15)
- # pathom (11)
- # programming-beginners (6)
- # reitit (6)
- # rewrite-clj (11)
- # shadow-cljs (14)
- # sql (1)
- # tools-deps (18)
- # utah-clojurians (3)
Hi folks, in my host page, for figwheel, should i include the /cljs-out/dev/main.js or main_bundle.js? (just started using npm import feature as well)
Now I run into this:
[Figwheel] Successfully compiled build dev to "target/public/cljs-out/dev/main.js" in 28.101 seconds.
[Figwheel] Bundling: npx webpack --mode=development target/public/cljs-out/dev/main.js -o target/public/cljs-out/dev/main_bundle.js
[Figwheel:SEVERE] Bundling command failed
asset bundle.js 644 bytes [emitted] (name: main)
ERROR in main
Module not found: Error: Can't resolve 'target/public/cljs-out/dev/main.js' in '/Users/marten/Sites/clojure/aviationglass'
webpack 5.1.3 compiled with 1 error in 60 ms
it seems you and I are having the same issue..
by your file path I assume you're using Mac OS, thus it should be a cross-platform issue because I'm using Linux
I have tried to fix it over the weekend using auto-bundle
and manual setup but I didn't have any luck!
what's your figwheel-main
version?
it sort of seems figwheel tries to read the file too soon by shelling out to npx too early or something.
ok solution (workaround): add this to your dev.cljs.edn
: :output-to "./target/public/cljs-out/dev/main.js"
ah, so @wcalderipe and I bumped into the same issue 🙂
https://github.com/bhauman/figwheel-main/blob/4406e9eeb312b32058398f0614a479b763dba303/src/figwheel/main.cljc#L154 Could it be that this shelling out somehow runs too early?
No that’s not it, manually running this npx command from my terminal (when main.js is definitely there), still yields this error
@wcalderipe $ npx webpack --mode=development ./target/public/cljs-out/dev/main.js -o target/public/cljs-out/dev/main_bundle.js
does run
great, mate.. thanks for sharing!
ok solution (workaround): add this to your dev.cljs.edn
: :output-to "./target/public/cljs-out/dev/main.js"
{:main aviationglass.core
:target :bundle
:output-to "./target/public/cljs-out/dev/main.js" ;; the ./ at the beginning is somehow mandatory.
:bundle-cmd {:none ["npx" "webpack" "--mode=development" :output-to "-o" :final-output-to]}}
I figured this out by trying deliberately to run the cli command manually with a wrong filename, this yielded the exact same error. Then I just took a plunge and tried with ./
in front, and it compiled :man-shrugging:
@wcalderipe @kah0ona As was noted in your thread, try downgrading the webpack version of 4.xx. I ran into this last night and that resolves the issue. Of course, your solution of modifying the :bundle-cmd
also works
haha solid timing 😉