hyperfiddle

JAtkins 2025-02-01T06:54:40.588519Z

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 app

Hendrik 2025-02-01T09:42:39.056859Z

so 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

Dustin Getz (Hyperfiddle) 2025-02-01T10:49:59.075979Z

first, please format better - use attachments not preformatted blocks, they are impossible to read

👍 1
Dustin Getz (Hyperfiddle) 2025-02-01T10:50:55.594439Z

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

Dustin Getz (Hyperfiddle) 2025-02-01T10:53:06.734939Z

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

JAtkins 2025-02-01T15:00:31.653359Z

JAtkins 2025-02-01T15:15:36.243899Z

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.

lsenjov 2025-02-01T15:19:45.327369Z

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

JAtkins 2025-02-01T15:23:03.511249Z

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

JAtkins 2025-02-02T05:11:27.812019Z

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.

Hendrik 2025-02-02T08:03:40.898619Z

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?

Dustin Getz (Hyperfiddle) 2025-02-03T14:14:04.282259Z

action required, entrypoint fix is in userland (starterapp entrypoint) not electric itself, see https://clojurians.slack.com/archives/C7Q9GSHFV/p1738591790727399

👍 1
JAtkins 2025-02-03T14:16:36.123469Z

Cool, I’ll try to close this out this morning

JAtkins 2025-02-03T20:44:09.894489Z

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