Is SSR support for Nuxt 3 planned ? #5372
Replies: 6 comments
-
| Thanks for opening this issue, I wasn't aware Nuxt 3 was this close to ready. Server-side rendering works in Vue 3, so should also work in theory in Nuxt 3. The relevant code is here: https://github.com/algolia/vue-instantsearch/blob/master/src/util/createServerRootMixin.js and https://github.com/algolia/vue-instantsearch/blob/master/src/components/InstantSearchSsr.js#L15 (although not much in that second file). If you already have a test setup with nuxt 3 + Vue InstantSearch that isn't working, it would save time implementing support if you could share that! | 
Beta Was this translation helpful? Give feedback.
-
| Hi @Haroenv , thanks for the quick answer. As I was working on a private project that I couldn't share, I took a moment to reproduce a project that is close to reality on CodeSandbox. You can find it here : https://codesandbox.io/s/nuxt-3-instantsearch-test-9c7oj5?file=/app.vue. So here is the current state: 
 
 Hope this can help you! | 
Beta Was this translation helpful? Give feedback.
-
| I tried as well to get it working without the layout and got closer by marking the CJS packages for vite in nuxt config:  | 
Beta Was this translation helpful? Give feedback.
-
| @Haroenv Is there any live example on Nuxt 3 with ais-instant-search-ssr ? | 
Beta Was this translation helpful? Give feedback.
-
| No, I haven't yet made an example. If you do, please share in this thread :) | 
Beta Was this translation helpful? Give feedback.
-
| Here's a carefully crafted example for anyone having difficulties to implement SSR in nuxt 3. | 
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
SSR for Nuxt 3 ⚡️
What is your use case for such a feature?
As Nuxt 3 is currently in Release Candidate version and its stable version is planned for "midsummer 2022" (see here), is the support of SSR with
<AisInstantSearchSsr>planned ?From what I have been able to test so far, using
<AisInstantSearch>for client-side rendering seems to work well with Nuxt 3. However, when implementing SSR as shown in the Algolia documentation, using<AisInstantSearchSsr>does not work. I guess thatcreateRootMixinand/or some other parts will have to be adapted to the new Nuxt 3 prerequisites.What is your proposal
I'm not so familiar with InstantSearch or Nuxt low-level concepts but if there is any way I can help, I would :)
What is the version you are using?
v4.3.3Beta Was this translation helpful? Give feedback.
All reactions