Fork me on GitHub

hello, I am trying to deploy my shadow-cljs/reagent app to github pages, but i can't make it work. When I use shadow-cljs watch app everything works just fine, but when i run shadow-cljs release app and try to open index.html or push the code to my github page, I get this js error : Error: No matching clause: . At first I thought that the app.js generated by the release command was faulty, but it seems to work just fine when i run it with a http server (lite-server). In all case the code is loaded just fine. It's just really confusing. What am I missing?


Hello! Are there some examples or articles of testing react-native project with shadow-cljs?


@postma.marin my guess would be that your routing fails but its hard to say. you can run shadow-cljs release app --pseudo-names or shadow-cljs release app --debug (to get source maps). should be easier to tell where it fails then


can :target :browser live in :build-defaults?


@thheller thanks! 🙂 it was indeed a routing problem!


I made progress. I got the CLJS part built with shadow, and then built the uberjar. When I run the app and view the start page, it’s missing JS. The console says:


The resource from "" was blocked due to MIME type ("text/html") mismatch (X-Content-Type-Options: nosniff).


@jmckitrick that is your server. looks like it tries to serve some other content under that url that isn't the JS. just open it in your browser normally and see what it is


I went back to the dev build, and am starting over. I’ll worry about the uberjar when I’m ready for deployment.


I think I had too many moving parts at once.


So loading that file in the browser gives me a 404 page


So the uberjar isn’t finding the payload generated by shadow, I assume.


Probably a simple setting in my project file… just gotta find it.


hey @thheller, when running a prepl-server and a socket-server, if I connect to the prepl-server I can't seem to start a repl in the socket-server


after connecting to the socket-server I get this:

shadow.user=> (shadow/repl :app)
null=> Execution error (AssertionError) at shadow.cljs.repl/read-one (repl.clj:536).
Assert failed: (symbol? read-ns)


is this something that's known, or should I create a repro + issue?


don't really understand what you are doing?


neither prepl nor socket-repl are used frequently so yeah there are most certainly issues


ah, all right.


sorry for being unclear, what I was doing is starting a prepl-server by putting {:prepl {:app 5555}} in shadow-cljs. I can connect to the prepl-server and it works fine. however, if I have a prepl-server running, and then connect to the socket-server, then I get the error I posted (`null=> Execution error (AssertionError) at shadow.cljs.repl/read-one (repl.clj:536).`)


either way, if it's not used much, don't bother about it. 🙂


I just need to reproduce it before I can look at it


by socket-server I assume you mean you also configured :socket-repl {:port 1234}?


I'm mostly lacking context for what you are doing .. there are too many things that you could be doing so I can't tell


I can just make a repro-repo and send it to you instead 🙂


I have an interesting problem here, I require react as an npm module. I have a macro which emits react/createElement. I cannot do that in my macro because compiler complains (I guess due to that “react” is not normal namespace, it is coming from npm, with normal namespaces this normally works). When I create some alias (def my-create-element react/createElement) and emit my-ns/my-create-element instead. All works, but release build suffers from generating dynamic arity dispatch. Even if I specify explicit fixed arity (defn my-create-element [x] (react/createElement x)) it does not get inlined in advanced mode (verified with --pseudo-names). Any ideas, how could I reference react/createElement in my macro directly? js/React.createElement does not work. “React” is not avail at runtime due to way how shadow isolates npm modules (?)


this is closest how I could get to what I want: that dirty set! emits: window.reactCreateElement=$APP.vl.createElement I need a way how to reference that $APP.vl (react npm import in my macro)