Deploy
Hi everyone
I'm deplyong my first solid start website, but the data seems to be static. I change it on the Sanity CMS, but when I come to the page the data remains the same.
Any idea how to solve it?
81 Replies
And I'm seeing
Error | Uncaught Client Exception
Can anyone please help me? 🙏I think it's realted with iconify, but why?
Relevant code?
It's my entire home page
I'm trying to deploy it on render.com and on my vps with coolify
but isn't fetching the data
it's always static
I update the data, and keeps showing the old data 😦
I'm using the icons for buttons etc
no idea how to solve it
and how to use the new data instead of the old data
Anyone can help me please? 😦
Send the code on how you data fetch
I disable the SSR and seems to works
For home page:
The only problem I'm facing is this error with iconify (with SSR disable)
with SSR disable the data updates when I change it on sanity, but the iconify error keeps appearing and I don't know how to solve it 😦
I'm totally desesperated, I need to deploy this today 😦
do you ever invalidate the getHome cache?
or do you mean it doesn't happen even on reload?
how are you using iconify btw? unocss?
No, I installed
@iconify/solid
How I can do that?
It's appearing on reload and hard reloadLet me send some docs
does sanity have some websocket thingy that tells you when it's updated?
if yes, you need to run this when that happens
I think not, but if I refresh the page the data now appears to be ok
the problem is only that error on
getComputedStyle
maybe try unocss to use iconify icons? that usually works for my solid start app
I'm using tailwindcss
UnoCSS
The instant on-demand Atomic CSS engine
but I will take a look
you can keep using tailwindcss
you can only use unocss just for icons
about the revalidate, where I should put the revalidate?
if sanity has some way to tell you when the data on the server is updated
there
usually its called like a subscribe function
this is from their docs
so inside the subscribe function
If you see, the error is only appearing on the home page
no errors for me on firefox linux
Can you try to navigate between routes and go back to home page please?
still nothing in the console
Ok, for me appears this sometimes
If its iconify, I'd try unocss or look in iconify/solid github issues
I need to see why it's happening to me only
@Raqueebuddin Aziz for some reason, now I can open the "Projetos" menu (projects)
and the error keeps appearing me
https://impulsionar.onrender.com/
So i try to use the tailwind plugin
Impulsionar
Impulsionar
the only problem is the dynamic ones that I can't load
Any idea?
Which are the dynamic ones?
it's coming from the sanity cms
I may be wrong but I've experienced that A LOT with Icon Libraries.
The problem is they are not ready for SSR so when Solid tries to do that... boom.
And the error is very random.
I use tabler icons for solidjs and it's laughable.
In my case, since I was using plenty of icons and my site is an app, I just went ahead and disabled SSR.
If you are using just 1 or 2, and absolutely need SSR:
1. try to wrap the components representing the icons with the client_only directive from solidjs
2. try to use the icon sources
I disable minify and the error appears on embla carousel
I’m out of ideas
I'm disabling SSR now to test
already wrap my carousel on client only, but didn't solve it
Any suggestion?
Is always returning only the fallback values (only on the deploy)
Keep facing the error on embla
Remove the carousel and the error appears again
I'm totally lost
Hello everyone
I remove AOS and seems that works fine now
Can you share how you initialised AOS?
Because it is a library that can only run on the client as it adds eventlisteners in the document which access the windows properties which don’t exist during SSR.
Thus it needs to be initialised within a onMount guess.
Like this:
https://stackblitz.com/edit/github-vkbuzw?file=src%2Froutes%2Findex.tsx
And use
clientOnly
to import on app.tsx
I create a component for initialize the AOS
Should I do it for page?Other thing that I'm facing only on the deploy is the SEO, I'm fetching the seo settings from Sanity, but I put a console.log and it's show me everything correct, but the meta tags are empty
Could be because of this memo:
You can try to wrap the Meta components in a Show and only display them when createAsync is resolved.
Ok, but the create async is inside of a context
About the AOS should I initialize it per page?
This is my seo component
And the context:
By the way tahnks @Madaxen86 and @Raqueebuddin Aziz for your time helping me 🙏
This does only depend on where you use the animations. If you use it on every page then keep it in the app.
I don't face any issues during SSR with the simple onMount implementation.
Thank you I will remove my create effect and use on mount
Because at this point when I remove all the animations the carousel is working without any error, so I will try to put the animations now again with onMount
https://impulsionar.onrender.com
Apparently works I added the data-aos on the second section only
Now need to put on other pages to see
If getSeo is wrapped in cache you bsically get context through the cache.
I think there's no need to have a context as all requests of getSeo will get deduped.
And try to fix the seo
Oh ok makes sense
One question any way to prevent createAsync to infer the type or undefined when I know that isn’t undefined
createAsync may always be undefined because it is async. What you can do in JSX is use the show component with the callback as children like:
inside effects you can make a copy and narrow with if:
Thank you
About the AOS, should I use the
clientOnly
to import it on app.tsx
?Seems not necessary to me. In the stackblitz it worked without clientOnly
thanks
Deploying on render.com seems to be working
on my own vps with coolify not 😦
What’s the error on Coolify?
two pages dont open
"Projetos" and Blog: https://impulsionar.devserver7.com
The pages don't load
but if I open in new tab works perfectly
I figure out the problem with help of @davedbase
Is basically a
createEffect
that I have to set search parameters
Thanks everyone
I think it's working now
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.After all isn't working everything 😦 But i can't replicate it anymore @Madaxen86 any tips for speed optimization? https://pagespeed.web.dev/analysis/https-impulsionar-devserver7-com/0lepc0s8od?form_factor=mobile
Maybe it is just this:
https://www.debugbear.com/blog/opacity-animation-poor-lcp
How CSS Opacity Animations Can Delay The Largest Contentful Paint |...
Chrome doesn't count elements with an opacity of 0 as LCP candidates. If the elements are repainted later on this can increase the LCP.
Maybe also use an different image on mobile so you don’t have to transform it on the fly or pretransform the image on upload.
Lighthouse is not always correct.
You're using Sanity CMS from what I remember. The page speed is likely b/c it's calling Sanity on every request. You could cache the sanity value so that you aren't waiting on a full round-trip.
I have cache on all the requests but how can cache the sanity it self?
Yeah it may not be the data fetching specifically (sorry I replied too quickly without reading Pagespeed properly). I think your suspense boundaries aren't in the right spots. The page is loading client side instead of SSRing. Plus the animations. Both might be killing your LCP.
For the image, you suggest anything specific to detect the device?
Just use a srcset with the different image sizes. The browser will then pick the correct one.
When using a cms you usually can configure to create different sizes (for phone, tablet, desktop,…) when you upload the image. Then you can make an image component which has all the sizes in a srcset.
Usually, I'm getting the image, and set the dimensions, for example
While the image is loading:
I get or the blur hash image, or get a very small image
probably I can do it for that images
Which sizes do you usally use?
You should checkout unpic: https://unpic.pics/img/solid/
There's a Sanity adapter for it too
It has a placeholder option as well: https://unpic.pics/placeholder/
I need to test it
I did it manually
I'm using this on almost all the images
Ooof that's a lot of work
the images for the hero sections only use the
onLoad
I need to test it
Thanks
I will try to find the documentation how to use it with sanityYeah your component is doing a lot more work than it needs to. I'd switch to unpic and let someone else manage that complexity 🙂
I'm trying this way, let me check
Afff, these appears me agian
@davedbase I replace all the images with
Unpic
page, but the result as the same: https://pagespeed.web.dev/analysis/https-impulsionar-devserver7-com/0pdvgxabp2?form_factor=mobileIt's good that you're using a proper image component (something you don't have to maintain) now you'll have to dive deeper into the optimization though.
I think there’s still something going on with the aos’ animations that cause the FCP and LCP to be so slow.
By visually testing, it seems just fine.
Yeah...
Seems that the rror comes back 😭😭