Open graforlock opened 6 years ago
I also have this question. I installed cursive to try it out and in a very basic hello world project it says "cannot resolve js/require". The Cursive website advertises "First class ClojureScript support" so I don't know why it seems to fail on basic builtins.
Related - https://github.com/cursive-ide/cursive/issues/1211
It is possible to avoid these issues to some extent by using the underlying Google Closure library, in this case the goog.dom
module. Add [goog.dom :as gdom]
to :require
and use (gdom/getElement "app")
instead of (.getElementById js/document "app")
.
You can find the Google Closure API docs here.
(I recognise that it has been two years since the issue was opened, but I hope this comment serves as documentation for other folk who run into this issue)
Hey @jozuas, I know this is an old thread, but there's something still bugging me about aliasing goog
namespaces to make Cursive detect them.
For example, if I only require a namespace, such as [goog.object]
like this, Cursive is not able to detect goog.object/get
function... But if I use an alias, such as [goog.object :as gobject]
, then Cursive is able to detect the symbol and offers pertinent documentation on the method (e.g. gobject/get
).
To your knowledge, is there a workaround to make it visible to Cursive with the former option?
cc @cursive-ide
Hi @joshuamzm, I do not know of a workaround, I switched to Doom Emacs 😄.
Whenever I try to do any of DOM type of stuff like
.getElementById
I getcannot resolve
. And that through a stock lein template for clojurescript. Is that the kind of support Cursive has for ClojureScript? Reloading/Invalidating etc does not help.If this is true and expected it'd be quite disappointing for CLJS support.
So my question is: Is this a bug or this is the degree of CLJS support?