Nuxt DevTools causes 404 error on custom HTTPS domain
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- nuxt, typescript
調査の方向性
nuxt.config.ts の HTTPS カスタムドメイン設定で再現し、その後 NUXT_DEVTOOLS_VIEW 周辺の NuxtDevServer.toNodeHandle と DevTools クライアントを調査する。localhost での動作と比較し、報告されたセットアップを実行する。完了条件は、HTTPS カスタムドメインで、/ _nuxt/ の 404 が繰り返し発生せず、クロスオリジンエラーも壊れたパネルもなく DevTools が読み込まれること。
索引モデルが issue の本文から書いたものです。
説明
Environment
- Nuxt: 4.2.2
- Node: v22.x
- OS: macOS
- Custom domain:
https://custom.domain.local:3000(local HTTPS with self-signed certificate)
Reproduction
Setup
npx nuxi init devtools-https-bug
cd devtools-https-bug
npm install
Generate local certificates
# Using mkcert (recommended)
mkcert -install
mkcert custom.domain.local
Configure nuxt.config.ts
export default defineNuxtConfig({
compatibilityDate: '2024-04-03',
devtools: { enabled: true },
devServer: {
https: {
key: './custom.domain.local-key.pem',
cert: './custom.domain.local.pem',
},
},
})
Add hosts entry
# Add to /etc/hosts (macOS/Linux) or C:\Windows\System32\drivers\etc\hosts (Windows)
127.0.0.1 custom.domain.local
Development Server
Start the development server:
npm run dev
Open https://custom.domain.local:3000 in the browser.
Describe the bug
When running the Nuxt dev server on a custom HTTPS domain (not localhost), DevTools causes repeated 404 errors in the terminal and a cross-origin error in the browser console.
Terminal error:
ERROR [request error] [unhandled] [GET] https://custom.domain.local:3000/_nuxt/
ℹ Error:
⁃ at createError (node_modules/@nuxt/cli/dist/dev-KB30iboK.mjs:54:14)
⁃ at NuxtDevServer.toNodeHandle (node_modules/@nuxt/cli/dist/dev-KB30iboK.mjs:264:18)
[CAUSE]
{
status: 404,
}
Browser console error:
SecurityError: Failed to read a named property '__NUXT_DEVTOOLS_VIEW__' from 'Window': Blocked a frame with origin "https://custom.domain.local:3000" from accessing a cross-origin frame.
at client.js?v=81bfbde2:136:13
Additional context
Expected behavior
DevTools should work without errors on custom HTTPS domains.
Actual behavior
- Terminal shows repeated
/_nuxt/404 errors fromNuxtDevServer.toNodeHandle - Browser console shows cross-origin
SecurityErrorfor__NUXT_DEVTOOLS_VIEW__ - DevTools panel fails to load properly
Workaround
Disabling DevTools eliminates the errors:
devtools: { enabled: false },
Additional context
- Works fine on
https://localhost:3000 - The issue appears to be DevTools probing
/_nuxt/(bare path with trailing slash) which returns 404 - May be related to the fix in nuxt/nuxt#31646, but that fix doesn't seem to cover this case
Logs
- 主要言語
- TypeScript
- スター
- 3.3k
- フォーク
- 214
- 平均マージ
- 19時間 45分
- マージ済み PR(30日)
- 12
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nuxt/devtools のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
bug needs reproduction
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
mksglu/context-mode#1200 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
anthropics/claude-code#96687 ·
-
good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
AOSSIE-Org/DebateAI#582 · コメント 2 件 ·