Cannot launch figwheel-ed node scripts with serve
Closed this issue · 5 comments
Hello @flyboarder,
this is actually a problem that I already see will be difficult to solve cleanly in boot
.
I am basically getting:
Figwheel: Can't start Figwheel!! Please make sure ws is installed
do -> 'npm install ws'
With the following task:
(deftask dev
"Launches the interactive environment"
[p port PORT int "Set the repl port"]
(let [port (or port 5055)]
(comp (watch)
(notify)
(reload :client-opts {:debug true}) ;; boot-figreload task
(cljs-repl :nrepl-opts {:port port})
(cljs :source-map true :optimizations :none)
(serve :script "app")))) ;; boot-nodejs task
This happens because the app.js
file is launched from the boot cache and of course does not have the correspondent node_modules
anywhere, neither in the folder, nor in the parent (which is the case when you actually execute a script from target
).
The solution of copying node_modules
to the boot cache is a scary one, so I leave this here open for discussion.
Boot-npm could do the node modules folder for you, do you have other suggestions?
I was actually thinking, together with Martin and other folks at EuroClojure, that a symlink could do the job very well. We could create it in the parent or same boot cache folder and delete it afterwards. In any case boot already uses links in the cache file. This would enable seamless and fast launch (no need to create a node_modules from scratch)
@arichiardi this actually has a few issues, boot doesn't support symlinks as far as I can tell
boot-clj/boot#609
boot-clj/boot#610
@arichiardi using the latest versions of the library should allow you to do this. Please reopen if you continue to have issues.