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 build fails with snitch version 0.1.15 #37

Open
bpringe opened this issue May 5, 2024 · 2 comments
Open

shadow-cljs build fails with snitch version 0.1.15 #37

bpringe opened this issue May 5, 2024 · 2 comments

Comments

@bpringe
Copy link

bpringe commented May 5, 2024

If I add version 0.1.15 of snitch to a project (shadow-cljs using deps.edn for dependency resolution), and add a require in an ns form like [snitch.core :refer [defn*]], when I run the shadow-cljs build it fails with this error:

------ ERROR -------------------------------------------------------------------
 File: jar:file:/Users/brandon/.m2/repository/org/clojars/abhinav/snitch/0.1.15/snitch-0.1.15.jar!/snitch/core.cljc:13:3
--------------------------------------------------------------------------------
  10 | ;; cljs deps can be excluded in a clojure only 
  11 | ;; project so the deps won't be available 
  12 | (try
  13 |   (require '[cljs.analyzer :as ana])
---------^----------------------------------------------------------------------
null
Alias ana already exists in namespace snitch.core, aliasing snitch.mock-analyzer at line 13 snitch/core.cljc
--------------------------------------------------------------------------------
  14 |   (catch Exception _
  15 |     (require '[snitch.mock-analyzer :as ana])))
  16 | 
  17 | 
--------------------------------------------------------------------------------

If I go back to snitch version 0.1.14, the build succeeds.

@AbhinavOmprakash
Copy link
Owner

Hey, thanks for reporting. I'm aware of this. I just haven't gotten around to fixing it.

I'm not sure what the best way to fix it is. I removed the the clojurescript dependency from the clojure project because I was having some issues with dependency conflicts due to libraries being pulled by clojurescript.

someone suggested that I separate snitch into 2 jars, one for clojure and one for clojurescript. I'm not too keen on doing that.

do you think there's any other way?

@bpringe
Copy link
Author

bpringe commented May 7, 2024

Hmm. I haven't looked into the issue, but can you exclude the dependencies being pulled in by ClojureScript that cause an issue, using Lein's method of doing that in the project.clj?

That error looks like you're trying to use an alias for that require which already aliases something else. Could you alias it as something other than ana or run (ns-unalias *ns* 'ana) right before (require '[cljs.analyzer :as ana]) in that try?

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