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

ClojureScript spec issues #127

Closed
nenadalm opened this issue Aug 22, 2018 · 4 comments
Closed

ClojureScript spec issues #127

nenadalm opened this issue Aug 22, 2018 · 4 comments

Comments

@nenadalm
Copy link
Contributor

Hi. I wanted to try reitit with Macchiato (macchiato-framework/macchiato-core#7), but it seems that specs are not compatible with ClojureScript (probably if there are 2 specs, it cannot be that 1st is using 2nd and 2nd is using 1st).

Problematic file

Steps to reproduce

  • create app with subset of the defined specs
(ns app.core
  (:require
   [clojure.spec.alpha :as s]))

(s/def ::path string?)

(s/def ::arg (s/and some? (complement sequential?)))
(s/def ::data (s/map-of keyword? any?))
(s/def ::result any?)

(s/def ::raw-route
  (s/nilable
    (s/cat :path ::path
           :arg (s/? ::arg)
           ;; if line below is commented out, node starts without issues
           :childs (s/* (s/and (s/nilable ::raw-routes))))))

(s/def ::raw-routes
  (s/or :route ::raw-route
        :routes (s/coll-of ::raw-routes :into [])))
  • compile into js
  • run js
$ node target/out/app.js 
 [Figwheel REPL] No WebSocket implementation found! Falling back to http-long-polling:
 For a more efficient connection ensure that "ws" is installed :: do -> 'npm install ws'
 [Figwheel REPL] Figwheel: Error loading file /var/www/html/nenadalm/cljs-spec-issue/target/out/app/core.js
 [Figwheel REPL] Error: Unable to resolve spec: :app.core/raw-routes
 [Figwheel REPL] Error loading file ../app/core.js
 [Figwheel REPL] Connected: http-long-polling
 [Figwheel REPL] Session ID: daa6dd4e-a45a-4638-b0e2-c8998fca9ae3
 [Figwheel REPL] Session Name: Laveta

note the line [Figwheel REPL] Error: Unable to resolve spec: :app.core/raw-routes above

@ikitommi
Copy link
Member

asked from the cloure-spec on Slack, no answer. Not sure how to fix this. Help welcome

@mfikes
Copy link

mfikes commented Oct 20, 2018

See https://dev.clojure.org/jira/browse/CLJS-2940

@ikitommi
Copy link
Member

thanks @mfikes!

@nenadalm
Copy link
Contributor Author

nenadalm commented Nov 9, 2018

closing as it does not occur anymore with org.clojure/clojurescript 1.10.439

@nenadalm nenadalm closed this as completed Nov 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants