[hydrateClient] import error happen time to time (clientComponents is empty)
See original GitHub issueSo I have several hydrateClient components in my project. Time to time (seems random for now), the component didn’t load and I get this error in my console
.
Uncaught (in promise) TypeError: Error resolving module specifier “undefined”. Relative module specifiers must start with “./”, “../” or “/”.
my page:
<script>
import Homecarousel from '../../components/Homecarousel.svelte';
</script>
<Homecarousel hydrate-client={{{ slides: data.slides }}>
And my component:
<script>
export let slides;
import Carousel from '@beyonk/svelte-carousel';
</script>
...
I need to save one of my client side component, even without change, in order to fix this.
Probably linked to: https://github.com/Elderjs/elderjs/issues/57
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:12 (8 by maintainers)
Top Results From Across the Web
React 18: Hydration failed because the initial UI does not ...
Importing and running some of the packages can cause this error too. For example, when I used Swiper.js package I encountered this problem....
Read more >Debugging and fixing hydration issues - somewhat abstract
The image URL is not working because the server handles the SVG in a very naïve way; we just use the import path,...
Read more >React Ssr Blinks Page - ADocLib
I tried preloading all images i.e create an array of <Image> comps with the different sources and I've r/reactnative A reminder app made...
Read more >Understanding Hydration in React applications(SSR)
CSR might take time to make the site visible to the users in case of slow ... but instead of having an empty...
Read more >react-hydration-error - Next.js
Why This Error Occurred ... different you can use `useEffect` which is only executed in the browser and is executed during hydration import...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The core of this issue comes down to the rollup plugin wiping out the folder that the glob is reading. We have a race condition.
Possibly we want to recursively try and get the list of files 5 times on a delay by extracting out the glob call into a function?
This seems more robust because the large a project gets the more this race condition becomes a problem.
Ideally esbuild would hit 1.0 already and we could use that in dev.
I actually need to save several times the same files to make it work. I’ll see if this PR: https://github.com/Elderjs/elderjs/pull/130 solves the problem as it seems to be played out at this level, if not we should deal with it as soon as possible.