drizzle-team / drizzle-team/drizzle-orm

[BUG]: Importing drizzle-kit into next.js route handler causes issue with next.js build

Open
#3,900 0 comments 1 reaction 0 assignees View on GitHub
bug drizzle/kit
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

### Report hasn't been filed before.

- [X] I have verified that the bug I'm about to report hasn't been filed before.

### What version of `drizzle-orm` are you using?

0.38.2

### What version of `drizzle-kit` are you using?

0.28.1

### Other packages

_No response_

### Describe the Bug

Importing drizzle-kit into next.js route handler causes issue with next.js build. See the following

```
* Causes issue with next.js build... so putting it here for now since we are not quite using it in prod yet
* TODO: Report issue to drizzle about this
../../node_modules/.pnpm/esbuild@0.17.5/node_modules/esbuild/lib/main.d.ts
Module parse failed: Unexpected token (1:7)
File was processed with these loaders:
* ../../node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js
* ../../node_modules/.pnpm/next@14.2.13_@babel+core@7.25.2_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js
You may need an additional loader to handle the result of these loaders.
> export type Platform = 'browser' | 'node' | 'neutral'
| export type Format = 'iife' | 'cjs' | 'esm'
| export type Loader = 'base64' | 'binary' | 'copy' | 'css' | 'dataurl' | 'default' | 'empty' | 'file' | 'js' | 'json' | 'jsx' | 'text' | 'ts' | 'tsx'

Import trace for requested module:
../../node_modules/.pnpm/esbuild@0.17.5/node_modules/esbuild/lib/main.d.ts
../../node_modules/.pnpm/esbuild@0.17.5/node_modules/esbuild/lib/ sync ^.*\/.*$
../../node_modules/.pnpm/esbuild@0.17.5/node_modules/esbuild/lib/main.js
../../node_modules/.pnpm/esbuild-register@3.5.0_esbuild@0.17.5/node_modules/esbuild-register/dist/node.js
../../node_modules/.pnpm/drizzle-kit@0.28.1/node_modules/drizzle-kit/api.mjs
.
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.