fix: bug-report endpoint /api collision (DEV-2114) + BugReportButton hydration (DEV-2017)#2
Merged
Conversation
… proxy collision (DEV-2114) Consuming Nuxt apps very commonly proxy all `/api/**` requests to a separate backend via Nitro `routeRules`. That catch-all swallowed `/api/bug-report` and forwarded it to the backend (404), so bug.lt's own server handler never ran on built/deployed apps. Add a configurable `endpoint` module option defaulting to `/_bug-lt/report` (Nuxt-internal `_`-prefix style, outside `/api/`). Expose it via `runtimeConfig.public.bugLt.endpoint`; register the server handler with `options.endpoint`; and read the same value in `useBugReport` so server and client always agree. Document the option and rationale in the README. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…match + RouterLink warning (DEV-2017) The floating button rendered a Nuxt UI `UButton` (which resolves to a NuxtLink with `to=undefined`) inside `<Teleport to="body">` during SSR. On the client this mismatched, logging `Failed to resolve component: RouterLink` plus hydration-node-mismatch warnings on every page. The button is a pure client-side UI overlay, so wrap the `<Teleport>`/`<UButton>` block in `<ClientOnly>` to skip SSR entirely. Behavior (position, color, screenshot capture, openModal) is unchanged. The modal needs no change — it is only ever mounted client-side via `useOverlay().create()` from a click, never in the SSR tree. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
github-actions Bot
pushed a commit
that referenced
this pull request
Jun 1, 2026
## [1.6.7](v1.6.6...v1.6.7) (2026-06-01) ### 🐛 Bug Fixes * bug-report endpoint /api collision (DEV-2114) + BugReportButton hydration (DEV-2017) ([#2](#2)) ([14b8d6b](14b8d6b))
Member
Author
|
🎉 This PR is included in version 1.6.7 🎉 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes two bugs that affected built/deployed consumer apps. Releases are automated via
semantic-release, so the package version is intentionally not hand-bumped — the merge of thesefix:commits will trigger the appropriate patch release.Fix 1 — DEV-2114: bug-report endpoint 404 on built/deployed apps
Root cause. The module registered its server handler at
/api/bug-reportand theuseBugReportcomposable did$fetch('/api/bug-report'). Consuming Nuxt apps very commonly proxy all/api/**requests to a separate backend via NitrorouteRules. That catch-all swallows/api/bug-report, forwards it to the backend (→ 404), and bug.lt's own handler never runs. Reproduced live: a built app with an/api/**proxy returned 404 forPOST /api/bug-report.Fix. Move the endpoint off
/api/and make it configurable:endpoint(string), default/_bug-lt/report(Nuxt-internal_-prefix style, like@nuxt/icon's/_nuxt_icon), which won't be caught by/api/**proxies.runtimeConfig.public.bugLt.endpoint = options.endpoint.addServerHandler({ route: options.endpoint, ... })(was hardcoded/api/bug-report).useBugReport):const endpoint = useRuntimeConfig().public.bugLt?.endpoint || '/_bug-lt/report'(was hardcoded/api/bug-report) — server and client now always agree.src/runtime.d.ts(PublicRuntimeConfig.bugLt.endpoint) andBugReportConfig.endpointoption and why (consumers proxying/api/**).The server handler file (
bug-report.post.ts) is unchanged — the route is declared explicitly inaddServerHandler, so only the registered route + client URL needed to change to match.Fix 2 — DEV-2017: BugReportButton hydration mismatch + "Failed to resolve component: RouterLink"
Root cause.
BugReportButton.vuerendered a floating Nuxt UIUButtoninside<Teleport to="body">during SSR.UButtonresolves toULink → NuxtLinkwithto=undefined, which renders an<a>on SSR but mismatches on client hydration → every page logged[Vue warn]: Failed to resolve component: RouterLink,Hydration node mismatch, andHydration completed but contains mismatches.Fix. The floating button is a pure client-side UI overlay, so its
<Teleport>/<UButton>block is now wrapped in<ClientOnly>— it never SSR-renders, eliminating the mismatch. Position/color/screenshot/openModal behavior is unchanged. The modal (BugReportModal) needed no change: it is only ever mounted client-side viauseOverlay().create()from a click handler (and the auto-mounted button is mounted via a separatecreateApp()in a client-onlyapp:mountedhook), so it is never part of the SSR tree.Build / lint / test
npm run prepack(build via@nuxt/module-builder): succeeds.npm run lint(eslint): clean, 0 errors / 0 warnings.npm test(vitest): 8 files, 51/51 tests pass. Updatedtest/module.test.tsto assert the new defaultendpointoption and theaddServerHandlerroute/_bug-lt/report(instead of the old/api/bug-report).🤖 Generated with Claude Code