Skip to content

Allow lazy loading of rendering dependencies on ssr mode #7053

@JeanJPNM

Description

@JeanJPNM

Describe the problem

Sveltekit currently has an issue where components that have dependencies using browser features such as the window and document objects throw errors during the component module initialization, preventing the framework from checking the component's module exports and deciding whether the component is suitable for server-side rendering.

Describe the proposed solution

Adding a compiler option to lazily load the dependencies of a component's regular <script>, allowing the framework to read the configuration of a page without loading modules that may be incompatible with the current environment.

Alternatives considered

Additional configuration options and special handler parameters

Importance

would make my life easier

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions