Skip to content

fix: NuxtHub 0.10.5+ compatibility#83

Merged
onmax merged 1 commit intomainfrom
82-incompatible-with-nuxthub-0-10-5-cannot
Jan 24, 2026
Merged

fix: NuxtHub 0.10.5+ compatibility#83
onmax merged 1 commit intomainfrom
82-incompatible-with-nuxthub-0-10-5-cannot

Conversation

@onmax
Copy link
Collaborator

@onmax onmax commented Jan 24, 2026

Summary

  • NuxtHub 0.10.5 no longer generates .nuxt/hub/db.mjs - now exports from hub:db alias
  • Same for hub:kv

Changes

  • src/module.ts: Changed imports from '../hub/db.mjs' to 'hub:db' and '../hub/kv.mjs' to 'hub:kv'

Reproductions

Fixes #82

@vercel
Copy link
Contributor

vercel bot commented Jan 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
nuxt-better-auth-docs Ready Ready Preview, Comment Jan 24, 2026 10:37am

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 24, 2026

Open in StackBlitz

npm i https://pkg.pr.new/onmax/nuxt-better-auth/@onmax/nuxt-better-auth@83

commit: 10d7b16

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 24, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
nuxt-better-auth-demo 10d7b16 Jan 24 2026, 10:37 AM

@onmax onmax force-pushed the 82-incompatible-with-nuxthub-0-10-5-cannot branch from 32d3b8c to 10d7b16 Compare January 24, 2026 10:35
@onmax onmax merged commit 8c3df20 into main Jan 24, 2026
6 checks passed
@onmax onmax deleted the 82-incompatible-with-nuxthub-0-10-5-cannot branch January 24, 2026 10:41
@adamkasper
Copy link
Contributor

adamkasper commented Jan 25, 2026

@onmax Hi, the error you dealt with here has started appearing again: #33

Error: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. Received protocol 'hub:'

Maybe it’s because you’re not using the new @nuxthub/db, etc.? Just run pnpm dev in this repository and it also crashes in playground/.

onmax pushed a commit that referenced this pull request Jan 25, 2026
This fixes the issue where using hub:db and hub:kv backwards compatibility
aliases was causing problems. The @nuxthub/core module creates physical
modules at @nuxthub/db and @nuxthub/kv (written to node_modules for workflow
compatibility), while hub:db and hub:kv are maintained only for backwards
compatibility.

Changes:
- Updated module.ts to use @nuxthub/db and @nuxthub/kv imports
- Updated validation to check for @nuxthub/db and @nuxthub/kv aliases
- Updated DevTools API files to use @nuxthub/db
- Updated test fixtures to use @nuxthub/db
- Updated documentation to reflect the recommended import pattern
- Updated type definitions to reference @nuxthub/db

This change aligns with NuxtHub's recommended approach where @nuxthub/db
is the preferred import that works with both Nuxt and external bundlers,
while hub:db remains for backwards compatibility (Nuxt only).

Resolves: Issue #83 comment about resurfaced error with hub: protocol aliases
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.

Incompatible with NuxtHub 0.10.5: Cannot find module .nuxt/hub/db.mjs

2 participants