Skip to content

nuxt db migrate fails: Cannot read connection.uri from undefined #707

@hcampbell98

Description

@hcampbell98

Describe the bug

When running npx nuxt db migrate, the command fails with "Cannot read properties of undefined (reading 'uri')" error. The error occurs because the code attempts to access hubConfig.db.connection.uri but the connection property doesn't exist in the database configuration object generated by NuxtHub.

Steps to reproduce

  1. Set up a NuxtHub project with SQLite database configured.
  2. Run npx nuxt db migrate command from the project root
  3. Observe the error after "Applying database migrations..." message

Expected behavior

The database migrations should be applied successfully without errors.

Technical Details

  • Database dialect: sqlite
  • Database driver: d1
  • The generated config at .nuxt/hub/db/config.json doesn't include a connection object under db, but the migration script expects it to exist

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions