Git Product home page Git Product logo

Comments (10)

bhb avatar bhb commented on August 24, 2024

Thanks for reporting this bug!

In order to help me track down the problem, can you please let me know:

  1. Your version of Clojure
  2. Your version of Clojurescript
  3. Your version of org.clojure/spec.alpha (if any)
  4. The 'require' statement for expound.

Thanks!

from expound.

pbrito avatar pbrito commented on August 24, 2024

I run the project with 'rlwrap lein figwheel'

lein -v                                                                                                                                                              
Leiningen 2.7.1 on Java 1.8.0_45 Java HotSpot(TM) 64-Bit Server VM

Dependencies in project.clj

  :dependencies [ [org.clojure/clojure "1.9.0-alpha12"]
                  [org.clojure/clojurescript "1.9.671"]
                  [expound "0.1.0"]]

  :plugins [[lein-figwheel "0.5.8"]]

In the repl I do
(require '[cljs.spec.alpha :as s])
instead of
(require '[clojure.spec.alpha :as s])

So when I use spec it goes well:

hello.core=> (s/explain :example/place {})
val: {} fails spec: :example/place predicate: (contains? % :city)
val: {} fails spec: :example/place predicate: (contains? % :state)
:cljs.spec.alpha/spec  :example/place
:cljs.spec.alpha/value  {}

But expound

hello.core=> (expound/expound :example/place {})
#object[TypeError TypeError: Cannot read property 'cljs$lang$applyTo' of undefined]
TypeError: Cannot read property 'cljs$lang$applyTo' of undefined
    at Function.cljs.core.apply.cljs$core$IFn$_invoke$arity$3 (file:///Users/paulo/clojure/spec-cljs/out/cljs/core.js:12870:5)
    at cljs$core$apply (file:/

from expound.

bhb avatar bhb commented on August 24, 2024

Thanks for the details! I am having trouble getting lein-figwheel 0.5.8 to work, but I can reproduce with that version of Clojure, Clojurescript and figwheel 0.5.11. I'm not sure what's going on - there seems to be some change in recent versions of Clojurescript where goog.string is not being loaded properly. I don't see the same problem on Clojurescript 1.9.542, but I realize that's not a great workaround. I'll see if I can figure out the issue tomorrow.

from expound.

bhb avatar bhb commented on August 24, 2024

I think I may have discovered a fix. Can you try the following:

  1. Clone this repo
  2. cd into the main dir
  3. lein install
  4. In your test project's project.clj, change [expound "0.1.0"]] to [expound "0.1.1-SNAPSHOT"]]
  5. Let me know if it is fixed :)

from expound.

pbrito avatar pbrito commented on August 24, 2024

error:
Could not find artifact expound:expound:jar:0.1.1-SNAPSHOT in clojars

from expound.

bhb avatar bhb commented on August 24, 2024

@pbrito That's correct: I haven't yet pushed it to Clojars. However, the lein install step should install it for you locally (once you have pulled down this repo). Did you get any errors when running lein install?

from expound.

pbrito avatar pbrito commented on August 24, 2024

Sorry! I didn't follow your instruction.

So, after following your instructions, I was able compiled without errors:

Wrote /Users/paulo/clojure/specT/expound/pom.xml
Installed jar and pom into local repo.

And using expound "0.1.1-SNAPSHOT" in my project returned:

dev:hello.core=> (expound/expound :example/place {})
-- Spec failed --------------------

  {}

should contain keys: `:city`,`:state`

-- Relevant specs -------

:example/place:
  (cljs.spec.alpha/keys
   :req-un
   [:example.place/city :example.place/state])

-------------------------
Detected 1 error

My project dependencies

  :dependencies [ [org.clojure/clojure "1.9.0-alpha12"]
                  [org.clojure/clojurescript "1.9.542"]
                  [expound "0.1.1-SNAPSHOT"]
                  ;[org.clojure/test.check "0.10.0-alpha2"]]

  :plugins [[lein-figwheel "0.5.11"]]

from expound.

bhb avatar bhb commented on August 24, 2024

@pbrito Thanks very much for confirming the fix! I'll release a new version with this fix sometime tonight.

from expound.

bhb avatar bhb commented on August 24, 2024

Fixed with 131d86c

from expound.

bhb avatar bhb commented on August 24, 2024

@pbrito Should be fixed in version [expound "0.1.1"] (now on Clojars). Thanks for the bug report!

from expound.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.