question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[hydrateClient] import error happen time to time (clientComponents is empty)

See original GitHub issue

So 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
nickreesecommented, May 11, 2021

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.

1reaction
kiuKisascommented, Mar 21, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found