Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drizzle Studio D1 Error: Could not read file: wrangler.toml #289

Open
ajzbc opened this issue Jan 13, 2024 · 2 comments
Open

Drizzle Studio D1 Error: Could not read file: wrangler.toml #289

ajzbc opened this issue Jan 13, 2024 · 2 comments

Comments

@ajzbc
Copy link

ajzbc commented Jan 13, 2024

Error:
✘ [ERROR] Could not read file: wrangler.toml

  ENOENT: no such file or directory, open '/Users/me/Library/Application Support/drizzle-studio/wrangler.toml'
// ./drizzle.config.ts
import type { Config } from 'drizzle-kit';

export default {
    schema: './src/db/schema.ts',
    out: './drizzle',
    driver: 'd1',
    dbCredentials: {
        wranglerConfigPath: './wrangler.toml',
        dbName: 'NAME'
    }
} satisfies Config;
# ./wrangler.toml
[[d1_databases]]
binding = "DB"
database_name = "NAME"
database_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
migrations_dir="drizzle"

Seems to be using the config, but looking for the wrangler.toml file in the wrong place

@jwhits
Copy link

jwhits commented Jan 13, 2024

This broke for me after a recent drizzle kit update. Seems to be looking for the wrangler.toml file using an absolute path and not relative path like it seems to on a previous version. As a temp fix I just put the correct absolute path in the covid for the wranglerConfigPath.

@flexchar
Copy link

I had to do same:

// drizzle.config.ts

// Join wrangler path with this file path
import path from 'path';
const wranglerConfigPath = path.resolve(__dirname, 'wrangler.toml');

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

No branches or pull requests

3 participants