P
Prisma4w ago
Jazz

"Failed to parse syntax of config file" when using config from D1 tutorial

I've copy pasted the config from the cloudflare d1 tutorial and am getting Failed to parse syntax of config file at.... Is it outdated? Furthermore, the official documentation for the adapter option also doesn't work
import type { PrismaConfig } from 'prisma';
import { PrismaD1 } from '@prisma/adapter-d1';

// import your .env file
import 'dotenv/config';

export default {
experimental: {
adapter: true,
},
schema: 'prisma/schema.prisma',
async adapter() {
return new PrismaD1({
CLOUDFLARE_D1_TOKEN: process.env.CLOUDFLARE_D1_TOKEN!,
CLOUDFLARE_ACCOUNT_ID: process.env.CLOUDFLARE_ACCOUNT_ID!,
CLOUDFLARE_DATABASE_ID: process.env.CLOUDFLARE_DATABASE_ID!,
});
},
} satisfies PrismaConfig;
import type { PrismaConfig } from 'prisma';
import { PrismaD1 } from '@prisma/adapter-d1';

// import your .env file
import 'dotenv/config';

export default {
experimental: {
adapter: true,
},
schema: 'prisma/schema.prisma',
async adapter() {
return new PrismaD1({
CLOUDFLARE_D1_TOKEN: process.env.CLOUDFLARE_D1_TOKEN!,
CLOUDFLARE_ACCOUNT_ID: process.env.CLOUDFLARE_ACCOUNT_ID!,
CLOUDFLARE_DATABASE_ID: process.env.CLOUDFLARE_DATABASE_ID!,
});
},
} satisfies PrismaConfig;
Thank you!
4 Replies
Prisma AI Help
You decided to hold for human wisdom. We'll chime in soon! Meanwhile, #ask-ai is there if you need a quick second opinion.
Nurul
Nurul4w ago
Hey! Which prisma version are you using? Could you try it with the prisma version 6.11.0 and then with the latest version (6.19.0) and check if you get the same error in both versions?
Jazz
JazzOP4w ago
I've actually just given up and switched to drizzle for now, sorry 🙁
Nurul
Nurul3w ago
Thanks for the feedback, we will work on verifying the docs instructions to ensure others don't run into this

Did you find this page helpful?