drizzle-team / drizzle-team/drizzle-orm

[BUG]:drizzle-kit generate and push failling with " Error input.replace is not a function"

Open
#6,071 7 comments 0 reactions 0 assignees View on GitHub
bug
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?

rc-4

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

rc-4

### Other packages

_No response_

### Describe the Bug

I upgraded from the latest stable release to the RC version and updated all of my schemas and relations to follow the RC-4 syntax across hundreds of schema files. I also ran `drizzle-kit up`, which successfully upgraded hundreds of migration files.

After the upgrade, I made multiple deployments that didn't require any schema changes, so everything worked as expected. However, a few days ago I introduced a new schema and added a new value to an existing enum. When I attempted to run `generate`, it failed with the following error:

```
Error: input.replace is not a function
```

I posted about this in the Discord server but haven't received a response yet.

This is a production project that has been using Drizzle since 2024, so the change was time-sensitive. As a workaround, I had to execute a raw SQL `ALTER TYPE` statement through Drizzle Gateway against the production database to add the enum value, which was far from ideal but necessary.

What's interesting is that `drizzle-kit migrate` still completes successfully and reports no pending changes. However, both `drizzle-kit generate` and `drizzle-kit push` fail with the same `input.replace is not a function` error.

I'd appreciate it if someone could take a look. I'm happy to provide any additional information, logs, configuration, or a minimal reproduction if needed.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure with drizzle-kit rc-4 after adding an enum value, running both generate and push, and compare the successful migrate command. Review the available configuration, logs, and any minimal reproduction; done means generate and push complete without the input.replace error while preserving the enum change.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql, typescript
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.