Skip to content

Conversation

@firdaus-edymainoe
Copy link
Contributor

When using the create @tanstack/start@latest command, the generated TanStack Start app fails to initialize when using the drizzle + sqlite add-on with the following error:

Cannot open database because the directory does not exist

This happens because the generated DATABASE_URL is set to file:./dev.db, but the better-sqlite3 driver
does not support the file: prefix. This commit removes that prefix and sets DATABASE_URL to dev.db
to ensure the app starts correctly.

This change is in line with Drizzle's latest documentation for using better-sqlite3.

…ABASE_URL prefix

The TanStack Start app fails to initialize when using the drizzle + sqlite add-on with the following error:

  Cannot open database because the directory does not exist

This happens because the generated `DATABASE_URL` is set to `file:./dev.db`, but the `better-sqlite3` driver
does not support the `file:` prefix. This commit removes that prefix and sets `DATABASE_URL` to `dev.db`
to ensure the app starts correctly.
@jherr jherr changed the title fix(react-cra): handle drizzle + better-sqlite3 driver error caused by DATABASE_URL prefix fix: handle drizzle + better-sqlite3 driver error caused by DATABASE_URL prefix Oct 23, 2025
@jherr jherr merged commit 172256a into TanStack:main Oct 23, 2025
@firdaus-edymainoe
Copy link
Contributor Author

Thank you @jherr!

@jherr
Copy link
Collaborator

jherr commented Oct 23, 2025

Thank you for being the first person to try out my new checksumming system that will help speed up content updates!

@firdaus-edymainoe
Copy link
Contributor Author

Haha! It's cool! I noticed the file and instinctively figured I should push this too. We should update the contributing.md file to include this instruction.

@jherr
Copy link
Collaborator

jherr commented Oct 24, 2025

Yes, we should! Thanks for reminding me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants