Skip to content

fix(docs): VitePress build fails - cannot resolve gtag type declaration#287

Merged
polaz merged 1 commit intomainfrom
fix/#285-fixdocs-vitepress-build-fails---cannot-resolve-gta
Feb 4, 2026
Merged

fix(docs): VitePress build fails - cannot resolve gtag type declaration#287
polaz merged 1 commit intomainfrom
fix/#285-fixdocs-vitepress-build-fails---cannot-resolve-gta

Conversation

@polaz
Copy link
Copy Markdown
Member

@polaz polaz commented Feb 4, 2026

Summary

  • Renamed gtag.d.ts to gtag.ts for Vite/Rollup compatibility
  • Vite cannot resolve .d.ts files as runtime imports during build
  • File content (declare global + export {}) is valid in both formats

Root Cause

The useGA4Tracking.ts composable imports ../types/gtag for type augmentation. Since gtag.d.ts is a TypeScript declaration file, Vite/Rollup cannot resolve it as a module at build time.

Test Plan

  • yarn lint passes
  • yarn test passes (4504 tests)
  • yarn docs:build succeeds (previously failed with "Cannot resolve ../types/gtag")

Fixes #285

- Vite/Rollup cannot resolve .d.ts files as runtime imports
- Renamed declaration file to regular .ts (content unchanged)
- File contains `declare global` + `export {}` which is valid in both formats

Fixes #285
Copilot AI review requested due to automatic review settings February 4, 2026 23:19
@polaz polaz enabled auto-merge (squash) February 4, 2026 23:19
@polaz polaz merged commit b3e980e into main Feb 4, 2026
18 checks passed
@polaz polaz deleted the fix/#285-fixdocs-vitepress-build-fails---cannot-resolve-gta branch February 4, 2026 23:21
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

polaz added a commit that referenced this pull request Feb 4, 2026
- Vite/Rollup cannot resolve .d.ts files as runtime imports
- Renamed declaration file to regular .ts (content unchanged)
- File contains `declare global` + `export {}` which is valid in both formats

Fixes #285
sw-release-bot bot pushed a commit that referenced this pull request Feb 4, 2026
## [6.55.1](v6.55.0...v6.55.1) (2026-02-04)

### Bug Fixes

* **docs:** rename gtag.d.ts to gtag.ts for Vite compatibility ([#287](#287)) ([b3e980e](b3e980e)), closes [#285](#285)
@sw-release-bot
Copy link
Copy Markdown

sw-release-bot bot commented Feb 4, 2026

🎉 This PR is included in version 6.55.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

polaz added a commit that referenced this pull request Feb 4, 2026
* feat(dashboard): add Instance Health Dashboard on GET / endpoint

- Add dashboard module with metrics collector, HTML template, and handler
- Dashboard shows server info, registered instances, health status, sessions
- Supports content negotiation: HTML for browsers, JSON for API clients
- Add DASHBOARD_ENABLED config (default true, disable with =false)
- Instances show health status (healthy/degraded/offline) based on metrics
- HTML includes auto-refresh every 30 seconds
- Safe for MCP clients - they use POST /mcp, not GET /
- Add 44 unit tests for metrics, handler, and HTML template

Closes #275

* fix(docs): rename gtag.d.ts to gtag.ts for Vite compatibility (#287)

- Vite/Rollup cannot resolve .d.ts files as runtime imports
- Renamed declaration file to regular .ts (content unchanged)
- File contains `declare global` + `export {}` which is valid in both formats

Fixes #285

* fix(dashboard): add error handling and safe URL parsing

- Add try/catch in dashboardHandler for collectMetrics/renderDashboard failures
- Add safe URL parsing in renderInstanceCard with fallback to raw URL
- Use GITLAB_TOKEN config constant instead of direct process.env access

* fix(dashboard): remove unused parameter and improve URL parsing

- Remove unused lastSuccessfulRequestMs parameter from determineInstanceStatus
- Add .js extension to dashboard import in server.ts
- Add safe URL parsing for session hostnames in html-template.ts
- Add comprehensive tests for collectMetrics function

* test(dashboard): achieve 100% line coverage

- Add tests for error handling in dashboardHandler
- Add tests for getMetrics export function
- Add tests for OAuth and token auth modes
- Add tests for unknown status indicator
- Add tests for invalid URL parsing fallbacks
- Add tests for queue filling warning
- Add tests for formatRelativeTime (hours, days)
- Add tests for invalid URL in sessions byInstance

Coverage: Lines 100%, Branches 92.85%
sw-release-bot bot pushed a commit that referenced this pull request Feb 4, 2026
## [6.56.0](v6.55.1...v6.56.0) (2026-02-04)

### Features

* **dashboard:** add instance health dashboard on GET / endpoint ([#286](#286)) ([de47c40](de47c40)), closes [#275](#275) [#287](#287) [#285](#285)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(docs): VitePress build fails - cannot resolve gtag type declaration

2 participants