bhauman / figwheel-main

Figwheel Main provides tooling for developing ClojureScript applications
https://figwheel.org
Eclipse Public License 1.0
640 stars 93 forks source link

Cannot build with ClojureScript 1.10.914/Figwheel 0.2.15 when `@babel/core` is in the `node_modules` folder. #310

Closed LeifAndersen closed 2 years ago

LeifAndersen commented 2 years ago

I'm not entirely sure if this is a figwheel specific bug or a general clojurescript one, but if I try to build anything with Clojure 1.10.914 and figwheel 0.2.15, and if the node package @babel/core is in the node_modules directory (but not used) I get the following error:

[Figwheel] Failed to compile build dev in 0.151 seconds.
[Figwheel:WARNING] Compile Exception: No implementation of method: :kv-reduce of protocol: #'clojure.core.protocols/IKVReduce found for class: java.lang.String  
[Figwheel:SEVERE] No implementation of method: :kv-reduce of protocol: #'clojure.core.protocols/IKVReduce found for class: java.lang.String

I have the following deps.edn file:

{:deps {org.clojure/clojure {:mvn/version "1.10.3"}
        org.clojure/clojurescript {:mvn/version "1.10.914"}
        com.bhauman/figwheel-main {:mvn/version "0.2.15"}
        com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"}}
 :paths ["src" "target" "resources"]}

Here is my dev.cljs.edn file:

{:main example.core}

And finally I have src/example/core.cljs:

(ns example.core)

(enable-console-print!)

(prn "hello world!")

To reproduce, put these three files in their directories, and run:

$ npm install @babel/core
$ clojure -m figwheel.main -b dev -r

Any thoughts on what the error might be?

kyleerhabor commented 2 years ago

I think I'm having this issue as well. The target directory was never populated after running figwheel in my instance.

bhauman commented 2 years ago

Does cljs 1.11.4 fix this?

bhauman commented 2 years ago

I just checked this and it appears that the latest version of CLJS fixes this. I'm going to close this unless someone discovers otherwise. Also apparently cljs-devtools is the victim of some deprecations in google closjure libs

https://github.com/binaryage/cljs-devtools/issues/63 One can set :cljs-devtools false to get rid of the compile warnings. Hopefully devtools will merge the fix soon so we can update figwheel to the new version.