Skip to content

fix(astro): lazy-load Storyblok components to prevent circular dependency#551

Open
dipankarmaikap wants to merge 1 commit intomainfrom
fix/WDX-387-storyblok-components
Open

fix(astro): lazy-load Storyblok components to prevent circular dependency#551
dipankarmaikap wants to merge 1 commit intomainfrom
fix/WDX-387-storyblok-components

Conversation

@dipankarmaikap
Copy link
Copy Markdown
Contributor

This PR switches Storyblok component imports to lazy loading to prevent circular dependency issues and improve build stability.

Previously, components were imported using eager imports, which could cause runtime errors like:

ReferenceError: Cannot access '$$Component' before initialization

This change introduces async component loaders and updates the runtime to resolve components lazily.

Fixes #547

Changes

  • Convert auto-imported Storyblok components to lazy imports
  • Convert manual component imports to lazy imports
  • Convert fallback component to lazy import
  • Update runtime to resolve components asynchronously

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: TDZ ReferenceError when Storyblok components have circular dependency through StoryblokComponent

1 participant