Comments (19)
Maybe I missed something scrolling through the output, but how is Austin affecting AOT? Not to say I doubt that Austin is to blame, I just can't think of a way, and I don't see a mention of it in the stack, etc.
from austin.
I ran into the same issue in the early stages of a ring/compojure/http-kit app.
I added austin and everything was working fine, but then I ran a lein do clean
and after this I started getting the same kind of stack trace that sgrove posted ending in Exception in thread "main" java.lang.NoClassDefFoundError: clojure/tools/reader/reader_types/Reader
I didn't realize that it had anything to do with austin until I asked for help in IRC, so I began selectively removing bits and pieces to see where the culprit was, and I narrowed it down to any calls involving middleware. Removing austin as a plugin fixed the issue.
from austin.
I should also note that I had austin in my :dev profile.
from austin.
Oh, I'll bet there's a version mismatch going on. What revs of ClojureScript, lein-cljsbuild, and austin are you using?
from austin.
austin: 0.1.3
clojurescript: 0.0-2030
lein-cljsbuild: 0.3.3
from austin.
Same issue here. Didn't realize this was Austin's doing.
from austin.
same here, with 1.0.0 lein-cljsbuild and cljs 2016. austin 0.1.3. Excluding org.clojurescript/clojurescript doesn't help either.
from austin.
My problem goes away if I run my uberjar with an explicit main class, instead of
java -cp myjar.jar clojure.main -m paddleguru.server
That was my mistake, as doing it this way double-compiles, causing issues with protocols.
My guess is that Austin includes some dep, maybe piggieback, that depends on cljs and has a (:gen-class)
in the header and is compiling the tools.reader protocols.
from austin.
I managed to get around this by moving the plugin to dev, then using these two macros to add my dev calls to my code shared with production:
(defn try-require [sym]
(try (require sym)
(catch Throwable _
(println "Namespace not available in current mode!" sym))))
(defmacro maybe-resolve [ns method]
`(when-let [n# (find-ns (quote ~ns))]
(when-let [m# (ns-resolve n# (quote ~method))]
@m#)))
from austin.
I'm having the same issue in this project: https://github.com/bellkev/dacom/tree/2a352a4da42993c046bc018a5dbf1b1080e959d4
Moving the plugin to the dev profile was a sufficient workaround for me.
from austin.
+1
Additionally I had to move the aot to my production profile. (Since I'm new to clojure I'm not sure if this makes sense)
from austin.
@LiFlash yup, that does make sense. I have it in my uberjar profile.
from austin.
@sritchie Thanks for the info. Hopefully I will understand what it is about (besides not delivering the source code), soon ;)
from austin.
I have a sneaking suspicion this is related to #37…
Open to any and all ideas as to what's going on.
from austin.
Moving it to [:dev :plugins]
does solve this issue for me, however, how do you guys go about building an uberjar of the project with :aot :all
? To serve the javascript for austin I have:
[cemerick.austin.repls :refer [browser-connected-repl-js]]
but since austin is only in :dev
, the uberjar build fails since it can't find the symbol.
from austin.
I do this for Weasel (same pattern worked for Austin):
(ns paddleguru.repl
"Helpers for interacting with Austin: https://github.com/cemerick/austin"
(:require [paddleguru.util :as u]))
(u/try-require 'cemerick.piggieback)
(u/try-require 'weasel.repl.websocket)
;; Use these to get the REPL running locally, connected to our live
;; server instance. For this to work you'll need to have started the
;; app from the repl itself.
(defn start! []
(when-let [cljs-repl (u/maybe-resolve cemerick.piggieback cljs-repl)]
(when-let [repl-env (u/maybe-resolve weasel.repl.websocket repl-env)]
(cljs-repl :repl-env (repl-env)))))
Here are try-require
and friends:
(s/defn try-require :- nil
[sym :- Symbol]
(try (require sym)
(catch Throwable _
(println "Namespace not available in current mode!" sym))))
(defmacro maybe-resolve [ns method]
`(when-let [n# (find-ns (quote ~ns))]
(when-let [m# (ns-resolve n# (quote ~method))]
@m#)))
That way I can have code that injects the repl snippet that works in dev mode, but just returns nil
in prod.
from austin.
Complete speculation, but this might be related to: http://dev.clojure.org/jira/browse/CLJ-1544
I see CLJ-1544 when a namespace containing a protocol manages to get require'd before AOT starts.
from austin.
I have investigated http://dev.clojure.org/jira/browse/CLJ-1544 today and I can confirm this is the root cause for this ticket.
from austin.
Thanks so much for tracking this down, @Bronsa and @arohner, much appreciated!
from austin.
Related Issues (20)
- Eliminate use of CrossPageChannel HOT 3
- Fail gracefully on attempts to use REPL env with disposed session
- Austin should not declare its own ClojureScript dependency HOT 5
- Cljs compiler env doesn't correspond to a refreshed browser env, with (disastrous!) consequences HOT 6
- NullPointerException with Clojurescript 0.0-2173 HOT 5
- NPE against org.clojure/clojurescript "0.0-2173" HOT 1
- Incompatibility with cljs 2173 HOT 1
- austin/exec-env fails w/ cljs 0.0-2173 HOT 3
- Hot reloading of HTML files not working in example project HOT 4
- Inexplicable problems with sample project HOT 3
- Can't require namespaces HOT 1
- Initial namespace not setup properly HOT 1
- Add support for adding JS dependencies. HOT 1
- tools.logging aot issue HOT 2
- Austin not compatible with cljs-2356 HOT 4
- clojurescript 0.0-2665 cannot compile austin 0.1.5 HOT 7
- Add production profile to browser-connected-repl-sample
- After loading (cemerick.austin.repls/exec), forms hang at repl prompt HOT 5
- After loading (cemerick.austin.repls/exec), austin fails with "No value supplied for key:" HOT 4
- Can't start repl
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from austin.