3

I'm trying to get started learning cljs by prototyping a react native app with expo. I set up a project with a Leiningen template "lein new expo". I installed cursive as well and added a configuration to connect it to the nRepl of my project.

The issue is that Cursive seems unable to resolve basic things. My basic hello world example is filled with "cannot resolve js/require". I must be missing some basic configuration for Cursive to warn about build in CLJS functions. Unfortunately I don't see anything about it in the documentation.

imagio
  • 1,390
  • 2
  • 16
  • 27

1 Answers1

1

I've seen Cursive resolve when there is JavaScript source it can parse in order to build an index. But, for many JavaScript interop calls, it is fairly normal for it to not resolve things.

With respect to your particular js/require is marked as unresolved for me as well.

Mike Fikes
  • 3,507
  • 14
  • 28
  • 2
    Hmm ok, the advertisement on the Cursive site of "first class support for Clojurescript" seems a little misleading then. I would at least expect it to know about Clojurescript/node/browser built in functions otherwise it is going to be warning about nearly everything and not provide much utility. – imagio Feb 21 '19 at 01:24
  • @imagio `require` is not a built in browser function, it only works in node. Since clojurescript is used almost exclusively client side (server side typically uses clojure itself on the JVM), I'm not surprised this doesn't work. – Jared Smith Feb 24 '19 at 19:40
  • @JaredSmith It works fine, something along the CLJS/RN pipeline is resolving modules included with js/require. This is just the basic hello world created by "lein new expo". It is just Cursive doesn't seem to know about the environment it is operating in so it indicates almost everything as "cannot resolve" even though the code works fine. – imagio Feb 25 '19 at 22:08