question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is SSR support for Nuxt 3 planned ?

See original GitHub issue

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 that createRootMixin and/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.3

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
robinsimonkleincommented, Jun 19, 2022

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:

  • Following the Algolia documentation, when I use createServerRootMixin in app.vue to get InstantSearch working in the whole app, layouts included, the server starts and logs the following error:
[Vue warn]: Failed to resolve component: NuxtPage
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
[Vue warn]: Unhandled error during execution of setup function
  at <Anonymous>
[nitro] [dev] [unhandledRejection] TypeError: Cannot read property '_route' of undefined
    at Module.useRoute (file:///sandbox/.nuxt/dist/server/server.mjs:1314:44)
    at setup (file:///sandbox/.nuxt/dist/server/server.mjs:17668:41)
    at callWithErrorHandling (/sandbox/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:157:22)
    at setupStatefulComponent (/sandbox/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:7084:29)
    at setupComponent (/sandbox/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:7039:11)
    at renderComponentVNode (/sandbox/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:172:17)
    at renderVNode (/sandbox/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:295:22)
    at renderVNodeChildren (/sandbox/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:310:9)
    at renderElementVNode (/sandbox/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:361:17)
    at renderVNode (/sandbox/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:292:17)
  • I also tried to set up the SSR only on the index.vue page, removing the layouts and app.vue. With this setup, the server does not start but does not display any error, neither in the terminal nor in the frontend console

Hope this can help you!

0reactions
Haroenvcommented, Dec 15, 2022

No, I haven’t yet made an example. If you do, please share in this thread 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nuxt 3 Release Candidate · Discussion #3447 - GitHub
We are planning to initiate a fresh rewrite of Auth module based on session support and composables from Nuxt 3. It is included...
Read more >
How To Use Server-Side Rendering with Nuxt.js - DigitalOcean
Nuxt.js is a framework for Vue.js applications that can solve this problem with server-side ... Rendering mode: Universal (SSR / SSG) ?
Read more >
Nuxt Server Side Rendering vs Pre-rendering
To build your Nuxt project using Server Side Rendering (SSR) you need to ensure your target is server in your Nuxt config file....
Read more >
Server Side Rendering - Nuxt
Server-side rendering (SSR), is the ability of an application to contribute by displaying the web-page on the server instead of rendering it in...
Read more >
Nuxt 3 Stable Launch – All the details from Nuxt Nation 2022
This makes Nuxt 3 a powerful web framework to build any modern website. Bridging single page applications (SPAs) and Server-Side Rendered (SSR) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found