This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-03
Channels
- # announcements (21)
- # aws (6)
- # babashka (28)
- # beginners (39)
- # biff (1)
- # calva (23)
- # cider (5)
- # clj-kondo (108)
- # clojure (11)
- # clojure-europe (17)
- # clojure-nl (2)
- # clojure-nlp (10)
- # clojure-uk (8)
- # clojurescript (29)
- # community-development (4)
- # conjure (20)
- # css (3)
- # datalevin (9)
- # datomic (3)
- # events (2)
- # figwheel-main (11)
- # fulcro (36)
- # honeysql (7)
- # humbleui (5)
- # interceptors (4)
- # introduce-yourself (3)
- # jobs (1)
- # lsp (51)
- # malli (1)
- # meander (71)
- # minecraft (8)
- # other-languages (18)
- # pathom (15)
- # polylith (25)
- # portal (10)
- # re-frame (5)
- # reitit (15)
- # releases (1)
- # remote-jobs (1)
- # shadow-cljs (11)
- # tools-deps (27)
thanks https://app.slack.com/team/U6GNVEWQG , i tried restarting, waiting longer, refreshing the page and also using different browsers, but none work once i have :target :bundle
. lsof also shows similar connections with/without using :target :bundle
Are there any other properties in your build file?
dev.cljs.edn
's content
^{:watch-dirs ["test" "src"]
:css-dirs ["resources/public/css"]
:auto-testing true
:log-file "figwheel-main.log"
:log-level :trace
:client-log-level :finest}
{:main learn-cljs.weather
:clean-outputs true
:target :bundle
:bundle-cmd {:none ["npx" "webpack" "--mode=development"
"--entry" :output-to
"--output-path" :final-output-dir
"--output-filename" :final-output-filename]
:default ["npx" "webpack" "--mode=production"
"--entry" :output-to
"--output-path" :final-output-dir
"--output-filename" :final-output-filename]}}
nothing in figwheel-main.edn
the project is basically created from example provided by https://www.learn-clojurescript.com/ mainly just, saved the following to ~/.clojure/deps.edn
{:aliases
{:new {:extra-deps {seancorfield/clj-new
{:mvn/version "1.1.243"}}
:exec-fn clj-new/create
:exec-args {}}}}
and run
clj -X:new :template figwheel-main :name learn-cljs/weather :args '["+deps" "--reagent"]'
then i just changed :target
to :bundle and added :bundle-cmd
. problem disappears if i comment out :target
Could you try to update your figwheel build to this instead?
^{:auto-bundle :webpack
:css-dirs ["resources/public"]
:watch-dirs ["src" "test"]}
{:main learn-cljs.weather}
And see if your able to 1. still run the app (I don’t know what the src looks like) and 2. that you can connect via the REPL.
(ensure you have webpack and webpack-cli installed as well)thanks. i changed dev.cljs.edn
to above and still face the same issue
deps.edn
{:deps {org.clojure/clojure {:mvn/version "1.10.0"}
org.clojure/clojurescript {:mvn/version "1.11.4"}}
:paths ["src" "resources"]
:aliases {:fig {:extra-deps
{com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"}
org.slf4j/slf4j-nop {:mvn/version "1.7.30"}
com.bhauman/figwheel-main {:mvn/version "0.2.17"}}
:extra-paths ["target" "test"]}
:build {:main-opts ["-m" "figwheel.main" "-b" "dev" "-r"]}
:min {:main-opts ["-m" "figwheel.main" "-O" "advanced" "-bo" "dev"]}
:test {:main-opts ["-m" "figwheel.main" "-co" "test.cljs.edn" "-m" "learn-cljs.test-runner"]}}}
src/learn-cljs/weather.cljs
(ns ^:figwheel-hooks learn-cljs.weather)
(println "This text is printed from src/learn_cljs/weather.cljs. Go ahead and edit it and see reloading in action.")
(defn mount-app-element []
(println "mount called"))
;; conditionally start your application based on the presence of an "app" element
;; this is particularly helpful for testing this ns without launching the app
(mount-app-element)
;; specify reload hook with ^:after-load metadata
(defn ^:after-load on-reload []
(mount-app-element))
package.json
{
"devDependencies": {
"webpack": "^5.72.0",
"webpack-cli": "^4.9.2"
}
}
i do notice the following though
Figwheel says compiled output is dev/main.js
and after bundling is dev/main_bundle.js
:
[Figwheel] Compiling build dev to "target/public/cljs-out/dev/main.js"
[Figwheel] Successfully compiled build dev to "target/public/cljs-out/dev/main.js" in 9.747 seconds.
[Figwheel] Bundling: npx webpack --mode=development --entry ./target/public/cljs-out/dev/main.js --output-path ./target/public/cljs-out/dev --output-filename main_bundle.js
but in html i see it is still using the output dev-main.js
(which is without using bundle).
<script src="cljs-out/dev-main.js" type="text/javascript"></script>
could this be the problem?Do you see an error in your browser console saying it can’t find dev-main.js
? If yes, update your index.html
script reference to dev/main.js
i changed to <script src="cljs-out/dev/main_bundle.js"
and it is working now. thanks athomasoriginal for all your helps 👍
ps: there was no error message in the browser console, probably because dev-main.js
was still around due to previous build. i have :clean-outputs true
but it seems to only clean up either based on current :target
or the folder dev
.