Error [LibsqlError]: URL_SCHEME_NOT_SUPPORTED: The client that uses Web standard APIs supports only
I am getting this error when my project have middleware. Error goes away when deleting middleware.ts
I am guessing it is because of
DATABASE_URL="file:./db.sqlite"
3 Replies
Do you import the client in the middleware directly or indirectly? For some reason the app thinks you are in non-server mode when creating the client. I've had similar thing, but I was actually importing indirectly client in the client component.
For better reference you'd need to share bit more on your setup: how project was created, what's the config, how libsql is imported etc. If you have link to the repo that's even better. Otherwise it's a bit hard to judge what might be wrong.
Take a look here for reference: https://github.com/tursodatabase/libsql-client-ts/blob/main/packages/libsql-client/package.json
The web import is pretty much no-go when it comes to
file:
scheme. So i'd look for a reason that import is referring to web-only client. If you wanna use local files, the import needs to be from node environment.GitHub
libsql-client-ts/packages/libsql-client/package.json at main · turs...
TypeScript/JavaScript client API for libSQL. Contribute to tursodatabase/libsql-client-ts development by creating an account on GitHub.
it's a newly created t3 app. all the database setup is default. I have only changed the schema and added a middleware.