Skip to content

fix: respect app.baseURL in devtools iframe src#322

Open
fabkho wants to merge 2 commits intonuxt:mainfrom
fabkho:fix/devtools-base-url
Open

fix: respect app.baseURL in devtools iframe src#322
fabkho wants to merge 2 commits intonuxt:mainfrom
fabkho:fix/devtools-base-url

Conversation

@fabkho
Copy link
Copy Markdown

@fabkho fabkho commented Apr 11, 2026

Summary

  • Fix DevTools custom tab iframe not loading when app.baseURL is set to a non-root value (e.g., behind a reverse proxy)
  • Use joinURL from ufo to prepend app.baseURL to the devtools iframe src

Fixes #321

Context

This is the same bug that was reported and fixed in @nuxt/a11y:

Changes

  • src/devtools.ts: Import joinURL from ufo and wrap DEVTOOLS_UI_ROUTE with joinURL(nuxt.options.app?.baseURL || '/', DEVTOOLS_UI_ROUTE) in the addCustomTab call
  • package.json: Add ufo as an explicit dependency

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 11, 2026

📝 Walkthrough

Walkthrough

This pull request adds a runtime dependency on the ufo package (version ^1.6.3) to package.json and updates the DevTools iframe src in src/devtools.ts to properly respect the app's baseURL configuration. The iframe src is now constructed by joining nuxt.options.app?.baseURL (or '/' as a fallback) with the DEVTOOLS_UI_ROUTE constant using the joinURL function from the newly added ufo package, fixing an issue where the iframe would fail to load when the app is served behind a reverse proxy with a custom base path.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: respecting app.baseURL in the devtools iframe src attribute.
Description check ✅ Passed The description clearly explains the bug fix, its context, and provides all necessary changes with specific file modifications and linked issue references.
Linked Issues check ✅ Passed The pull request fully addresses issue #321 by implementing the exact fix described: importing joinURL from ufo and wrapping DEVTOOLS_UI_ROUTE with it in src/devtools.ts, plus adding ufo as a dependency.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the requirements: only src/devtools.ts and package.json are modified to fix the baseURL issue with no extraneous modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@package.json`:
- Line 51: package.json was updated to add the "ufo" dependency but the pnpm
lockfile wasn't regenerated, which breaks CI with frozen-lockfile; run pnpm
install (or pnpm install --lockfile-only) locally to regenerate pnpm-lock.yaml,
verify the lockfile includes the new "ufo" entry, and commit the updated
pnpm-lock.yaml alongside the package.json change so CI/release can proceed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 31d2084b-0637-4e99-8852-622fbe03eed8

📥 Commits

Reviewing files that changed from the base of the PR and between 86b47d2 and 7f48fc0.

📒 Files selected for processing (2)
  • package.json
  • src/devtools.ts

Comment thread package.json
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 11, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/hints@322

commit: 81489e1

@huang-julien huang-julien self-assigned this Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DevTools tab iframe does not respect app.baseURL

2 participants