drizzle-orm: [BUG]:Drizzle-Kit 0.19.0 Fails to Generate Migrations
What version of drizzle-orm are you using?
0.27.0
What version of drizzle-kit are you using?
0.19.0
Describe the Bug
I was using Drizzle Kit version of 0.18.1 and generating migrations with this command.
drizzle-kit generate:pg --config=drizzle.config.ts
As soon as I updated drizzle-kit to 0.19.0 version this command doesn’t work anymore throwing the error
TypeError [ERR_INVALID_RETURN_PROPERTY_VALUE]: Expected a url string to be returned for the "url" from the "drizzle-kit/loader.mjs 'resolve'" function but got instance of String.
Expected behavior
No response
Environment & setup
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 8
- Comments: 47 (15 by maintainers)
We’ve decided to rollback ESM support for drizzle-kit, as it was causing a lot of issues on Windows and some issues on Mac. We want to unblock drizzle-kit and give all of you the opportunity to get new ORM and kit updates.
We have gathered a lot of feedback, and errors have appeared. Additionally, we have managed to set up proper test environments for Windows, Mac, and Linux, which has been really helpful.
We will be working on improvements on another branch at a pace that suits us, so that we can ensure we are not blocking anyone here.
Thank you all for your patience and for reporting the issues and sharing information!
The rollback is already available under the
drizzle-kit@cjstag and will be included in the latest version todayI am surprised to see that drizzle-kit is not open-source. All we can do is complain 😑
@AlexBlokh Tried it out with the new version, getting a different error now
It seems to just fail on any drizzle-kit command now with this error
can confirm that in a brand new and latest dependencies version of next 13 changing
tsconfig’stargettoesnextdefinitely worked. i originally tried to change the lib but noticed it was already set toesnext, then noticed that its actually thetargetfield that needs to be set!My
tsconfig.jsonalready hastarget: "ESNext"and it doesn’t work so might not be a fix for everyone.hmmmm, I see
I have my schema split into multiple files and that causes it to now fail with
Error [ERR_MODULE_NOT_FOUND]. If I move everything into 1 schema file, then it starts working, but only if I’m not importing anything from a another file (e.g../shared)Can confirm that I am getting the same on Mac.
Using latest version 0.19.0
Latest config and everything based on the new release notes.
Unfortunately, the error still persists. I’m using the same schema and migration generate command as before in 0.18.1 and have updated the drizzle.config.ts as you have mentioned, but am still getting an error.
Here is the link to the repo if somebody wants to inspect it.