Deploying changes to SolidStart app then navigating the application throws strange error
Before I file this as an official issue or start nagging the rest of the team I want to make sure I'm not deploying or thinking about the issue incorrectly. Basically I'm deploying a SolidStart app on Cloudflare Workers, loading it on my browser, pushing a deploy and noticing that when I navigate between pages an error is thrown.
I could be wrong but it seems to happen mostly with Outlets. When I navigate to a page with one, the application loads the nested chunked script that was compiled newly while the one currently cached in browser is older. Hence the child trips up and throws an error because the function it depends on no longer exists. So I see a lot of red errors as a result.
How should I be deploying this to ensure that the function names between versions remain consistent and my deployments don't break? or is this a bug with Start's default config.
50 Replies
how dare that error use the wrong pronouns! /s
seems like that error is tied to some use of
for (..of He(...))
I think the solution here is to ensure that the parent and children of an Outlet are packaged together...?
Do you mind if I try to RE the output files?
I'm seeing
[$,_]=He(!0)
near const{clearSession:D,breakpoints:Q}
weird
He
turns out to be createSignal
Ok maybe it's not related to the outlets :p
clearSession, breakpoints are pulling from a site-wide context
Perhaps the new chunk that's being pulled is out of sync with the context value?
or am I just totally not comprehending the issue lol
issue is confusing. It says that
createSignal
is neither a function nor the value it returns is iterable, which is weirdIs it because the variable that it’s expecting to pull from context is changing? Like the incoming chunk has a new variable name? I’m assuming the terser uses different identifier on every rebuild
it does, but the variable itself is consistently mapped, which is why it is weird
I can recreate it consistently. Whenever I rebuild it throws the error until I hard refresh.
Interesting...
I really need to resolve this tmrw. Any ideas, send them my way. I'm blocked from updating a project without solve it lol
Maybe the main guy @nksaraf
side mention: @ryansolid
we cant do much if files from across versions of the app are coexisting
I thought the hashing in the filenames would assure that there's no conflict when the new version is asked for.. it should never be cached
the first time
Was a bit confused by this line. Wondering what a safe solution might be and didn’t consider changing the cache
Re-reading it, are you suggesting that all the hashed assets be maintained in the dist folder? Cloudflare Worker has a habit of purging everything not in dist so when I build the old hashed assets are removed....
normally old hashed assets shouldnt be fetched
I wanted to add a feaeture for this inbuilt
so if the user is on a page and you deploy a new version, it should cause some kind of reload
and maybe the client should handle not finding an asset
and cause a reload for that
Ah, ok that makes sense. I suppose the question is how can I implement this right now?
Sounds similar to Service Worker reload strategy
Yeah I havent implemented this before .. just had an idea
I need to figure out a stopgap solution for the time being
I think the issue im seeing is that the .js file names dont have hashes in them
I would have assumed all the client side javascript would be with hashed filenames
even entry-client and stuff
I had the hashes in them at one point, had the same issue
As I'm understanding the issue, I think I need to deploy with the hashes but ensure that they remain in the Cloudflare Worker instead of purging the entire codebase on build
Basically accumulate the build dir not override it so that it maintains the old hash locations
hmm im so confused lol.. how do people not face this all the time?
I'm so confused too tbh
dont all services make older assets unavailable
Major cloudflare pages does this automagically?
I using a raw worker
a newer page shouldnt ask for an older page Im goes
true
maybe I introduced a new issue when I removed the hashes. let me try with it
and I need the build dir to keep all the hashed scripts in cache
need to solve that too
I mean but nobody does this.. how has this stuff been working forever
Good question.
Yeah I found some details about it. This is a typical ChunkLoadError and it's related to not keeping the cached scripts of old builds. People report it in issues like: https://github.com/cloudflare/wrangler-legacy/issues/1553
GitHub
Option to continue serving old resources · Issue #1553 · cloudflare...
Currently, it seems like when you deploy a Worker Site, if users are still on the 'previous version' and they request a resource they may not get it. For example, UserScreen.abcd.js...
So I suppose just using Pages is my solution
@davedbase also I forgot to mention, does this happen on all pages?
No just the ones with chunks that are fetched
I think
Hmmmm Cloudflare Pages seems to be much better when I redeploy...
Did hit a minor and SUPER strange issue just now...
I can deploy via Pages and it works well: https://romamoulding-com.pages.dev/
RomaMoulding.com
Roma Moulding is a world leader in high-quality Italian-made framing.
But when I attach a domain I get a weird error: https://stg.romamoulding.com/
RomaMoulding.com
Roma Moulding is a world leader in high-quality Italian-made framing.
It's the same worker...the only thing that's changed is the custom domain is pointing to it via a CNAME
Very likely a userland problem but it's plaguing me. lol. I'll conclude the issue because this seems the right path
(Not particularly related to this problem, but just wanted to point out that clicking on the "favorite" icon under products shows an error if you haven't selected any products before)
seems to be working right now
Yeah there’s a plethora of minor bugs. The site was coded in a rush so we’re just slowly cleaning and optimizing it.
It's not working 100%. There seems to be a hydration issue on the page on the stg subdomain which isn't happening on the pages.dev link
ohh didnt notice lol
Ugh it's so annoying. Why the hell is there a difference between the custom domain and not?
cries lol
this errors always like fucking kill me right now
Nikhil lost it 🤣
I feel your pain. I'm going to dive into it tmrw. Trying my best to stay offline today for ma bday
didn't know you and Ryan share birthdays
1 day apart actually lol
Tanner, Ryan and the real talent share the same day haha
the oldies have talents
jk
Happppyy Birthdayyy man!!
Thx you