Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shadow-cljs setup instructions not working #249

Closed
Risto-Stevcev opened this issue Aug 19, 2020 · 8 comments
Closed

Shadow-cljs setup instructions not working #249

Risto-Stevcev opened this issue Aug 19, 2020 · 8 comments

Comments

@Risto-Stevcev
Copy link
Contributor

I followed the instructions in the docs to set up vim-iced with shadow-cljs that you outlined in issue #105 , but it's not working.

After following the steps:

  1. Generate a test project
  2. Set up shadow-cljs.edn
  3. Start to watch
    • npx shadow-cljs watch frontend
  4. Open app.cljs
    • vim src/main/acme/frontend/app.cljs
  5. Connect and start cljs repl
    • :IcedConnect
    • :IcedStartCljsRepl shadow-cljs frontend

Everything was going ok until this step:

:IcedStartCljsRepl shadow-cljs frontend

Where I get:

Missing dependency: refactor-nrepl/refactor-nrepl => 2.5.0
Missing dependency: nrepl/nrepl => 0.7.0
Missing dependency: iced-nrepl/iced-nrepl => 1.0.4
Some dependencies or middlewares are missing. It will be the cause of malfunction.
Do you proceed? (Y/n):

How do I get it to install these? I have this shadow-cljs.edn:

;; shadow-cljs configuration
{:source-paths
 ["src/dev"
  "src/main"
  "src/test"]

 :dependencies [[refactor-nrepl "2.5.0"]
                [cider/cider-nrepl "0.25.3"]
                [iced-nrepl "1.0.4"]]

 :nrepl {:cider false
         :middleware [cider.nrepl/wrap-classpath
                      cider.nrepl/wrap-clojuredocs
                      cider.nrepl/wrap-complete
                      cider.nrepl/wrap-debug
                      cider.nrepl/wrap-format
                      cider.nrepl/wrap-info
                      cider.nrepl/wrap-macroexpand
                      cider.nrepl/wrap-ns
                      cider.nrepl/wrap-out
                      cider.nrepl/wrap-spec
                      cider.nrepl/wrap-test
                      cider.nrepl/wrap-trace
                      cider.nrepl/wrap-undef
                      cider.nrepl/wrap-xref
                      refactor-nrepl.middleware/wrap-refactor
                      iced.nrepl/wrap-iced]}

 :dev-http {8080 "public"}

 :builds
 {:frontend
  {:target :browser
   :modules {:main {:init-fn acme.frontend.app/init}}
   }}}
@liquidz
Copy link
Owner

liquidz commented Aug 19, 2020

@Risto-Stevcev Thanks for your reporting!
Which version are you using?

Similar problem is fixed at ver 2.1.4.
https://github.com/liquidz/vim-iced/blob/master/CHANGELOG.adoc#214-2020-08-15
Could you try latest version?

@Risto-Stevcev
Copy link
Contributor Author

Ah thanks. That fixed that warning about dependencies, but now it just fails sliently and returns :cljs/quit

@liquidz
Copy link
Owner

liquidz commented Aug 19, 2020

Oh, that's strange.
I'll have a look.

@liquidz
Copy link
Owner

liquidz commented Aug 19, 2020

@Risto-Stevcev I confirmed.

https://github.com/liquidz/vim-iced/blob/2.1.6/autoload/iced/nrepl/cljs.vim#L23-L24
:cljs/quit is a display issue and does not affect actual operation. (I'll fix it)

With nvim 0.4.4 and vim 8.2, I could confirm that evaluating :IcedEval (js/alert "foo") will show dialog on browser.

@Risto-Stevcev
Copy link
Contributor Author

Oh that's odd, it's working now. I'm not sure what happened, sorry about that o_O
Maybe it was caching issue -- I ended up deleting all of the sample apps I was testing out with vim-iced and cider and went through this flow again

@Risto-Stevcev
Copy link
Contributor Author

Ah I figured out how to reproduce the problem I was running into,

If you follow all of the steps but you don't visit http://localhost:8080/, then trying to evaluate anything will return nil and the following message:

See https://shadow-cljs.github.io/docs/UsersGuide.html#repl-troubleshooting

If it's a shadow-cljs specific behavior it might be worth mentioning that you have to visit the http://localhost:8080/ first before eval-ing in the docs

@Risto-Stevcev Risto-Stevcev reopened this Aug 19, 2020
liquidz added a commit that referenced this issue Aug 19, 2020
@liquidz
Copy link
Owner

liquidz commented Aug 19, 2020

@liquidz
Copy link
Owner

liquidz commented Aug 20, 2020

I've cut a new release, and documents are updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants