kibu-australia / pushy

Clojurescript library for quick and easy HTML5 pushState
Eclipse Public License 1.0
223 stars 28 forks source link

Unknown exception after upgrade from 0.2.2 to 0.3.0 during CLJS compilation #5

Closed hzhu closed 9 years ago

hzhu commented 9 years ago

Unknown exception after upgrade from 0.2.2 to 0.3.0 during CLJS compilation. Using secretary 1.2.3

Compiling ClojureScript.
Compiling "target/prod/scripts/app.js" from ["src" "src-client"]...
Compiling "target/prod/scripts/app.js" failed.
clojure.lang.ExceptionInfo: failed compiling file:src-client/main/client.cljs {:file #<File src-    client/main/client.cljs>}
    at clojure.core$ex_info.invoke(core.clj:4403)
    at cljs.compiler$compile_file.invoke(compiler.clj:1040)
    at cljs.compiler$compile_root.invoke(compiler.clj:1070)
    at cljs.closure$compile_dir.invoke(closure.clj:353)
    at cljs.closure$eval3165$fn__3166.invoke(closure.clj:393)

Usage:

(ns main.client
(:require [reagent.core :as reagent :refer [atom]]
        [secretary.core :as secretary :refer-macros [defroute]]
        [pushy.core :as pushy :refer [push-state!]]
        [main.core :as core])
 (:import goog.History))

 (reagent/render-component [core/app-view] (.getElementById js/document "app"))

 (push-state! secretary/dispatch!

 (fn [x] (when (secretary/locate-route x) x)))

If I switch to back to "0.2.2" in project.cljs it comes fine. And everything works.

https://github.com/hzhu/reagent-nodejs Any ideas?

wavejumper commented 9 years ago

I should have made it clear in README.md that there were breaking changes in 0.3.0

To keep it simple, I have re-added the push-state! function to 0.3.1 , which will construct and return a new pushy instance plus start the event listeners.

Let me know if upgrading to 0.3.1 fixes your problems

hzhu commented 9 years ago

@wavejumper upgrading to 0.3.1 does the trick! Thank you.

wavejumper commented 9 years ago

@hzhu no worries :)