Skip to content

Error when running "npx nuxt db generate" #697

@mrkaashee

Description

@mrkaashee

Description

On a new Nuxt project following the Nuxthub documentation (basic setup, no custom code),
running the command:

npx nuxt db generate

produces the following error:

npx nuxt db generate
ℹ Ensuring database schema is generated...                                                                 7:46:09 pm
ℹ Generating database migrations...                                                                        7:46:18 pm
Reading config file 'C:\Users\mrkaashee\OneDrive\Desktop\hubby\.nuxt\hub\db\drizzle.config.ts'
 Error  No schema files found for path config ['.nuxthubdbschema.mjs']
 Error  If path represents a file - please make sure to use .ts or other extension in the path

 ERROR  Command failed with exit code 1: drizzle-kit generate "--config=./.nuxt/hub/db/drizzle.config.ts"   7:46:18 pm

    at getFinalError (/C:/Users/mrkaashee/OneDrive/Desktop/hubby/node_modules/@nuxthub/core/node_modules/execa/lib/return/final-error.js:6:9)
    at makeError (/C:/Users/mrkaashee/OneDrive/Desktop/hubby/node_modules/@nuxthub/core/node_modules/execa/lib/return/result.js:108:16)
    at getAsyncResult (/C:/Users/mrkaashee/OneDrive/Desktop/hubby/node_modules/@nuxthub/core/node_modules/execa/lib/methods/main-async.js:168:4)
    at handlePromise (/C:/Users/mrkaashee/OneDrive/Desktop/hubby/node_modules/@nuxthub/core/node_modules/execa/lib/methods/main-async.js:151:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
    at async Object.run (/C:/Users/mrkaashee/OneDrive/Desktop/hubby/node_modules/@nuxthub/core/cli/commands/db/generate.mjs:41:24)
    at async runCommand (/C:/Users/mrkaashee/OneDrive/Desktop/hubby/node_modules/citty/dist/index.mjs:316:16)
    at async runCommand (/C:/Users/mrkaashee/OneDrive/Desktop/hubby/node_modules/citty/dist/index.mjs:307:11)
    at async runMain (/C:/Users/mrkaashee/OneDrive/Desktop/hubby/node_modules/citty/dist/index.mjs:445:7)



 ERROR  Command failed with exit code 1: drizzle-kit generate "--config=./.nuxt/hub/db/drizzle.config.ts"   7:46:18 pm

Here is .nuxt\hub\db\drizzle.config.ts

import { defineConfig } from 'drizzle-kit'

export default defineConfig({
  dialect: 'sqlite',
  schema: '.nuxt\hub\db\schema.mjs',
  out: 'server\db\migrations\sqlite'
});

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdb

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions