I'm doing something obvious and dumb. But I'm not sure what it is lol. I have this in my user.cljc for a new-spin project (i.e. not a fork of electric-starter-app) user.cljc
~~moved to a code block in the thread below~~
This code when booted causes the Main function to receive nil, even though the clj side properly provides a config and ring request
(e/boot-server {}
personal-rss-feed.admin.electric-app.main/Main
(e/server config)
(e/server ring-request))
I think the issue is on the client side b/c I'm not wrapping the two nil args with (e/server nil) . Makes sense, this is how the starter app does things and I'm not doing that right now, however I get the following compilation error when I try to match the starter app:
------ WARNING #1 - :undeclared-var --------------------------------------------
File: /home/jarrett/code/personal/personal-rss-reserver/src/dev/user.cljc:109:17
--------------------------------------------------------------------------------
106 | ((e/boot-client
107 | {}
108 | personal-rss-feed.admin.electric-app.main/Main
109 | (e/server :client) ;; config is nil on the client
-----------------------^--------------------------------------------------------
Can't take value of macro hyperfiddle.electric3/server
--------------------------------------------------------------------------------
110 | :client ;; ring request is nil
111 | )
112 | #(js/console.log "Reactor success:" %)
113 | #(js/console.error "Reactor failure:" %))))
--------------------------------------------------------------------------------
And I can't for the life of me figure out why I get this compilation error on my project but not on the starter appso to be clear. you did the following steps?: • clone starter app • cd into app dir • rename the file which defines Main to personal_rss….clj_c_ • start clojure with dev alias • evaluate dev alias • error
first, please format better - use attachments not preformatted blocks, they are impossible to read
i think there are multiple questions here, but the main one is that entrypoint dependency injection of config and ring request is coming through nil, which is a known regression, we're looking at it now
wrt the macro error, i agree with Hendrik's proposed next step, i.e., copy/paste the working starter app, and then modify to suit your needs, so you can bisect the exact change that breaks compilation. We are happy to improve the entrypoint resilience to misconfiguration but we need to understand what's happening first
I'll have to mess with this more tonight. There's something very small different between my setup and the starter app, so I guess I just need to spend a few hours copying code back and forth.
I'm about to head to bed, but I'm seeing this as well.
The ring-request is not nil in src-dev/dev.cljc L34, but is nil when passed into Main (or at least, ring-request in Main is nil)
This is on a fresh checkout of the starter app
I don’t get that. <<wild speculation>> I’ve been very curious though if the v3-snapshot is actually always updated to the most recent. I’m typically running the starter app beside my real app, and their behavior isn’t always the same. Could be me, but maybe deps doesn’t always check for newer jars on start? I’m not sure but I need to eliminate this possibility from my env
disconfirmed speculation btw. The jar is stored (no hash) in your local .m2 cache, and for me both the starter app and my personal app use the same file path.
It seems that the starter app on your machine is working. Did you try to converge step by step from the starter app to your app so that you can notice on which change it breaks?
action required, entrypoint fix is in userland (starterapp entrypoint) not electric itself, see https://clojurians.slack.com/archives/C7Q9GSHFV/p1738591790727399
Cool, I’ll try to close this out this morning
I got it working finally. I'm not sure really what happened to alleviate the compilation error, but I'm not about to complain lol. I'm just happy to move on