drizzle-team / drizzle-orm

Headless TypeScript ORM with a head. Runs on Node, Bun and Deno. Lives on the Edge and yes, it's a JavaScript ORM too 😅
https://orm.drizzle.team
Apache License 2.0
24.54k stars 643 forks source link

[BUG]: Error importing schema #1705

Closed snikoletopoulos closed 4 months ago

snikoletopoulos commented 10 months ago

What version of drizzle-orm are you using?

^0.29.2

What version of drizzle-kit are you using?

^0.20.8

Describe the Bug

When loading the app and trying to authenticate with passport the following error is thrown from the schema file, or the services if i comment out the line that breaks

Module parse failed: Unexpected token (28:7)
web:dev: You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
web:dev: | });
web:dev: |
web:dev: > export type User = typeof users.$inferSelect;
web:dev: | export type NewUser = typeof users.$inferInsert;
web:dev: |
web:dev:
web:dev: Import trace for requested module:
web:dev: ../../packages/database/src/schema.ts
web:dev: ../../packages/database/src/index.ts
web:dev: ./src/libs/auth/strategies.ts
web:dev: ./src/pages/api/auth/login.ts

Expected behavior

No response

Environment & setup

Monorepo with nextjs app with passport as auth and database and services packages. It worked fine before switching from prisma to drizzle

Dakkers commented 10 months ago

is your project using typescript?

Angelelz commented 10 months ago

We'd need to have a reproduction repo to see what environment you're in and see if there's something drizzle should do.