lilactown / helix

A simple, easy to use library for React development in ClojureScript.
Eclipse Public License 2.0
627 stars 52 forks source link

Cursive Stub Generation Fails #79

Closed emmanuj closed 3 years ago

emmanuj commented 3 years ago

Stub generation fails in Intellij Cursive with the following error:

Error generating stubs for module demo-app: clojure.lang.ExceptionInfo: Library name must be specified as a symbol in :require / :require-macros; offending spec: ["react" :as react] at line 1 jar:file:/Users/emmanuel.john/.m2/repository/lilactown/helix/0.0.13/helix-0.0.13.jar!/helix/core.cljs {:file #object[java.net.URL 0x790ed2d9 "jar:file:/Users/emmanuel.john/.m2/repository/lilactown/helix/0.0.13/helix-0.0.13.jar!/helix/core.cljs"], :line 1, :column 1, :tag :cljs/analysis-error}
                at cljs.analyzer$error.invokeStatic(analyzer.cljc:645)
                at cljs.analyzer$error.invoke(analyzer.cljc:641)
                at cljs.analyzer$error.invokeStatic(analyzer.cljc:643)
                at cljs.analyzer$error.invoke(analyzer.cljc:641)
                at cljs.analyzer$basic_validate_ns_spec.invokeStatic(analyzer.cljc:2008)
                at cljs.analyzer$basic_validate_ns_spec.invoke(analyzer.cljc:1999)
                at cljs.analyzer$parse_require_spec.invokeStatic(analyzer.cljc:2107)
                at cljs.analyzer$parse_require_spec.invoke(analyzer.cljc:2103)
                at clojure.lang.AFn.applyToHelper(AFn.java:171)
                at clojure.lang.AFn.apply... (show balloon)

I'm using the following deps:

org.clojure/clojurescript       {:mvn/version "1.10.773"}
thheller/shadow-cljs            {:mvn/version "2.11.6"}
lilactown/helix                       {:mvn/version "0.0.13"}

Cursive apparently do not like this. Is it possible to change the 'require' to use symbols only where possible?

lilactown commented 3 years ago

I would like to support Cursive better, but my understanding is that "react" is a perfectly valid require.

It looks like this feature in Cursive worked once before, and now this is a regression? I'm not sure. https://github.com/cursive-ide/cursive/issues/2330 is the issue w.r.t. adding stub generation for helix's macros.

I would suggest filing a ticket with Cursive to that they are aware of the bug when analyzing CLJS files which use string requires.

emmanuj commented 3 years ago

I had already filed a ticket to cursive-ide (https://github.com/cursive-ide/cursive/issues/2465) since I wasn't sure where this issue should go. Closing this one.