#Engineering

Drizzle is a popular ORM for TS/JS applications, and Quotion is built on it.

The error

I have encountered the cannot read properties of undefined (reading 'columns') error quite a few times, as shown below:

The image displays a detailed error message from a JavaScript application, indicating an 'Internal error: TypeError' related to reading properties of undefined, specifically 'columns'. The error originates from within the Drizzle ORM library, with a stack trace pointing to various modules and functions within the application's codebase. The overall mood is one of frustration and urgency, as the error suggests a critical failure in the application's data handling.

The solution

The error message isn’t very helpful, and the root cause may be that you have forgotten to export some tables as a schema, especially when you use folders to save table files, you created a new table but forgot to export it as schema.

The fix is quite simple: you just need to export all your database tables as the schema, and this issue should be gone.

Hope it resolves your errors as well. 🙏