nuxt-modules / nuxt-modules/ionic

fix: server side fetch

Open
#167 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
457
Forks
53
Avg merge
7h 32m
Merged PRs (30d)
21

Description

🐛 The bug

Fetching data on server side within ionic page component is not possible.

It can be observed in the repro attached that the fetch call happens on the client side only and therefore updating meta tags will have no effect for SEO, social media previews, etc

Server side code executes only in app.vue as far as I can see

🛠️ To reproduce

https://stackblitz.com/edit/nuxt-starter-gjtb8z?file=pages%2Fhead.vue

🌈 Expected behaviour

It's possible to provide code that's executed server side before entering the page.

ℹ️ Additional context

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked StackBlitz reproduction at pages/head.vue and compare it with the server-side execution described for app.vue. Trace why the fetch runs only on the client in the Ionic page component. Done means page-level code can execute server-side before navigation and the resulting metadata is available for SEO and social previews.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxtjs, typescript
Domain
frontend, mobile, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.