Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

fix(ssr): forward slots of the AisInstantSearchSsr component #898

Merged
merged 5 commits into from
Dec 18, 2020

Conversation

Haroenv
Copy link
Contributor

@Haroenv Haroenv commented Dec 16, 2020

The clone created in findResultsState also manually needs to forward slots, or the data won't be available.

The clone created in findResultsState also manually needs to forward slots, or the data won't be available.
Haroenv added a commit that referenced this pull request Dec 16, 2020
@Haroenv
Copy link
Contributor Author

Haroenv commented Dec 16, 2020

@eunjae-lee
Copy link
Contributor

eunjae-lee commented Dec 16, 2020

yarn build && (cd examples/nuxt && yarn && yarn dev)

image

I guess it happens here.

Did I do it wrong?

It works after deleting .nuxt.

@Haroenv
Copy link
Contributor Author

Haroenv commented Dec 16, 2020

you possibly still have an old version of the package installed somehow (maybe nuxt cache or something like that), I had it as well, but not sure what causes the old version to stay

Copy link
Contributor

@eunjae-lee eunjae-lee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense but it didn't work when I visited / first and clicked /search-2 with the following error:
image

And it'd be nice to have a test case to cover this.

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 23f625f:

Sandbox Source
vue-instantsearch-e-commerce Configuration

@Haroenv
Copy link
Contributor Author

Haroenv commented Dec 18, 2020

@eunjae-lee
Copy link
Contributor

eunjae-lee commented Dec 18, 2020

https://codesandbox.io/s/frosty-shadow-lm50t?file=/pages/search-2.vue

It seems to work except for one thing that might be related to this.

  • / -> /search: works
  • / -> /search-2: works
  • between /search and /search-2: doesn't work

Never mind. search-2 had two InstantSearch components nested. Now it's fixed and it seems fine.

@Haroenv Haroenv merged commit 60b595e into master Dec 18, 2020
@Haroenv Haroenv deleted the fix/ssr-slots branch December 18, 2020 10:27
Haroenv added a commit to algolia/instantsearch that referenced this pull request Dec 28, 2022
…/vue-instantsearch#898)

* fix(ssr): forward slots of the AisInstantSearchSsr component

The clone created in findResultsState also manually needs to forward slots, or the data won't be available.

* Update src/util/createServerRootMixin.js

* chore: also forward root

* scoped slots doesn't work, add tests
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants