Drizzle config file unable to locate env file
I'm trying to create a SvelteKit app, with Drizzle and PostgreSQL using this tutorial: https://sveltekit.io/blog/drizzle-sveltekit-integration and the SvelteKit documentation for env import modules https://kit.svelte.dev/docs/modules#$env-static-private
I've created a drizzle.config.ts file in my root containing the code he gives, and a .env file in my root containing some variables. I'm getting the error
Cannot find module '$env/static/private' or its corresponding type declarations. ts(2307)
when I try and import the env file with import { env } from '$env/static/private';
and Type '"pg"' is not assignable to type '"d1-http"'.ts(2322)
on the drizzle driver declaration line.
It seems that typescript is unable to find the local file perhaps? Any idea what might be causing these errors?Drizzle and SvelteKit Integration - The Ultimate Stack
Drizzle is the best ORM going around at the moment. So let's integrate it with the best framework - SvelteKit. In this article we'll walk through the process of getting your SvelteKit app from 0 to fully integrated with Drizzle.
SvelteKit docs
Modules • SvelteKit documentation
0 Replies