Describe the bug
Failed to deploy when using drizzle orm.
May be i miss something? but i check many times drizzle setup flow and didnt get how to deploy)
plugins/migration.ts
if i remove migrations - there another error in utils
import { drizzle } from 'drizzle-orm/d1' <- cannot resolve drizzle
import * as schema from '../database/schema'
export { sql, eq, and, or } from 'drizzle-orm'
export const tables = schema
export function useDrizzle() {
return drizzle(hubDatabase(), { schema })
}
export type User = typeof schema.users.$inferSelect
Steps to reproduce
Steps to reproduce the behavior:
Step by step setup drizzle orm from NuxtHub doc
Run db:generate and check thats drizzle works locally - can create new user, get users list
Push to repo and check deployment flow
Expected behavior
there some error from deployment logs
12:00:35.899 [info] [nitro] Building Nuxt Nitro server (preset: `cloudflare-pages`)
12:00:36.410 [error] [nitro] Error: Cannot resolve "drizzle-orm/d1/migrator" from "/opt/buildhome/repo/server/plugins/migrations.ts" and externals are not allowed!
12:00:36.411
12:00:36.411
12:00:36.411 undefined
12:00:36.413 [error] Cannot resolve "drizzle-orm/d1/migrator" from "/opt/buildhome/repo/server/plugins/migrations.ts" and externals are not allowed!
12:00:36.413 at Object.resolveId (node_modules/.pnpm/nitropack@2.9.6_@opentelemetry+api@1.8.0/node_modules/nitropack/dist/nitro.mjs:1966:17)
12:00:36.413 at async PluginDriver.hookFirstAndGetPlugin (node_modules/.pnpm/rollup@4.18.0/node_modules/rollup/dist/es/shared/node-entry.js:19674:28)
12:00:36.413 at async resolveId (node_modules/.pnpm/rollup@4.18.0/node_modules/rollup/dist/es/shared/node-entry.js:18355:26)
12:00:36.413 at async ModuleLoader.resolveId (node_modules/.pnpm/rollup@4.18.0/node_modules/rollup/dist/es/shared/node-entry.js:18758:15)
12:00:36.414 at async Object.resolveId (node_modules/.pnpm/@rollup+plugin-commonjs@25.0.8_rollup@4.18.0/node_modules/@rollup/plugin-commonjs/dist/es/index.js:588:10)
12:00:36.414 at async PluginDriver.hookFirstAndGetPlugin (node_modules/.pnpm/rollup@4.18.0/node_modules/rollup/dist/es/shared/node-entry.js:19674:28)
12:00:36.414 at async resolveId (node_modules/.pnpm/rollup@4.18.0/node_modules/rollup/dist/es/shared/node-entry.js:18355:26)
12:00:36.414 at async ModuleLoader.resolveId (node_modules/.pnpm/rollup@4.18.0/node_modules/rollup/dist/es/shared/node-entry.js:18758:15)
12:00:36.414 at async node_modules/.pnpm/rollup@4.18.0/node_modules/rollup/dist/es/shared/node-entry.js:19062:50
12:00:36.414
12:00:36.414 [error] Cannot resolve "drizzle-orm/d1/migrator" from "/opt/buildhome/repo/server/plugins/migrations.ts" and externals are not allowed!
12:00:36.581 Failed: Error while executing user command. Exited with error code: 1
12:00:36.592 Failed: build command exited with code: 1
12:00:38.307 Failed: error occurred while running build command
Describe the bug Failed to deploy when using drizzle orm. May be i miss something? but i check many times drizzle setup flow and didnt get how to deploy) plugins/migration.ts
if i remove migrations - there another error in utils
Steps to reproduce Steps to reproduce the behavior:
Expected behavior there some error from deployment logs