Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Nuxt middleware & page setup does not execute in the expected order when refreshing page

オープン
#564 コメント 5 件 リアクション 2 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
nuxtjs, typescript
領域
frontend, mobile

調査の方向性

リンクされている StackBlitz の再現例から始め、Nuxt-only、Ionic、i18n、Ionic-plus-i18n の各構成を比較します。issue で言及されている nuxt.config の router 統合設定を確認し、リフレッシュ時の挙動を再現します。完了条件は、組み合わせたセットアップが次の期待される順序を維持することです: グローバル middleware、ページ middleware、app setup、ページ setup。

索引モデルが issue の本文から書いたものです。

説明

bug
🐛 The bug

I was using middleware to fetch user configuration data before navigating to pages, when I realized that the page setup was run before the middleware. Through some trial and error I figured out that removing Nuxt/ionic fixed the issue, but I also found out that adding the Nuxtjs/i18n module worsened the issue.

So I created a project tracking the following:

  • Global middleware
  • Page middleware
  • App setup function
  • Page setup function

And I got these results:

  • (Nuxt alone) works as expected:
    image
  • (Nuxt + Nuxt/ionic) App setup gets run first but everything else in the correct order:
    image
  • (Nuxt + Nuxtjs/i18n) works as expected:
    image
  • (Nuxt + Nuxt/ionic + Nuxtjs/i18n) every page setup is run before middleware
    image

I'm still pretty new to Nuxt & Ionic so I might be completely missing some critical information, but the Nuxt/ionic documentation gives the impression that middleware should just work with no caveats.

🛠️ To reproduce

https://stackblitz.com/edit/hui123

🌈 Expected behaviour

For the execution order to match the basic Nuxt project when refreshing the page, and to also work with the i18n nuxt module

  1. Global middleware
  2. Page middleware
  3. App setup function
  4. Page setup function
ℹ️ Additional context

Reproductions used to get the different results:
Nuxt middleware order (Nuxt only)
Nuxt middleware order (Ionic)
Nuxt middleware order (i18n)
Nuxt middleware order (Ionic + i18n)

It might be related to the ionic router integration, because if I disable it in nuxt.config the execution order goes back to normal.

主要言語
TypeScript
スター
458
フォーク
53
平均マージ
15時間 54分
マージ済み PR(30日)
25

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nuxt-modules/ionic のほかの issue

nuxt-modules/ionic の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。