Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed component lookup for shared/svelte/page.svelte #125

Merged
merged 1 commit into from
Nov 23, 2022
Merged

Conversation

NJKode
Copy link
Contributor

@NJKode NJKode commented Nov 23, 2022

Say you have a component with the following file structure:

[component-folder]
└── nested
    └── component
        ├── component.svelte
        └── component.bookshop.yaml

And the following object in your SvelteKit route:

component: {
  "_bookshop_name": "nested/component"
  "component_key": "component_value"
}

You should be able to render this using <Bookshop {...component} />.

However, Bookshop trips up due to the fact that the component is within a folder (nested/). Bookshop will look for the file [component-folder]/component/nested/component/nested.svelte, which does not exist.

The fix is to use the existing getComponentKey() function.

@bglw bglw merged commit e2b57e9 into main Nov 23, 2022
@bglw bglw deleted the page-component-fix branch November 23, 2022 01:31
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.

2 participants