Skip to content

Consistent handling of base between preloadCode and preloadData #10398

@WaltzingPenguin

Description

@WaltzingPenguin

Describe the problem

When using base in a project, preloadCode works only if I give it a path excluding base. preloadData works only if I give it a path including base. Additionally, preloadData will error if no paths match but preloadCode does not.

With the combination of these issues and no immediate visible impact on the application, it is very easy to have preloadCode calls that are broken and do nothing. Tracking them down inside an application of any size is difficult.

Repo to test: https://github.com/WaltzingPenguin/sveltekit-preload

Describe the proposed solution

preloadCode should require base as part of the path to match preloadData (and goto). preloadCode should also throw an error if it did not match any routes.

Alternatives considered

No response

Importance

would make my life easier

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions