prisma-generator-drizzle
prisma-generator-drizzle copied to clipboard
`prisma generate` throw Error: `Expected property name or '}' in JSON at position 29`
I followed the instructions in the README and executed the relevant commands.
However, when I reached the following command, an error occurred.
I searched extensively on search engines but couldn't find a solution.
generator client {
provider = "prisma-generator-drizzle"
}
datasource db {
provider = "sqlite"
url = "file:../prisma.db"
}
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
}
prisma:engines binaries to download libquery-engine, schema-engine +156ms
prisma:get-platform Found distro info:
{
"targetDistro": "debian",
"familyDistro": "debian",
"originalDistro": "ubuntu"
} +4ms
prisma:get-platform Trying platform-specific paths for "debian" (and "ubuntu") +0ms
prisma:get-platform Found libssl.so file using platform-specific paths: libssl.so.3 +0ms
prisma:get-platform The parsed libssl version is: 3.0.x +0ms
prisma:loadEnv project root found at /home/work/package.json +246ms
prisma:tryLoadEnv Environment variables loaded from /home/work/.env +5ms
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
prisma:getConfig Using getConfig Wasm +3ms
prisma:getConfig config data retrieved without errors in getConfig Wasm +7ms
prisma:get-platform Found distro info:
{
"targetDistro": "debian",
"familyDistro": "debian",
"originalDistro": "ubuntu"
} +1ms
prisma:get-platform Trying platform-specific paths for "debian" (and "ubuntu") +0ms
prisma:get-platform Found libssl.so file using platform-specific paths: libssl.so.3 +1ms
prisma:get-platform The parsed libssl version is: 3.0.x +0ms
prisma:getConfig Using getConfig Wasm +34ms
prisma:getConfig config data retrieved without errors in getConfig Wasm +1ms
prisma:getDMMF Using getDmmf Wasm +0ms
prisma:getDMMF Using given datamodel +0ms
prisma:getDMMF dmmf data retrieved without errors in getDmmf Wasm +36ms
prisma:getGenerators neededVersions {} +294ms
Error: Error:
Expected property name or '}' in JSON at position 29
at Mf.parse (/home/work/node_modules/.pnpm/[email protected]/node_modules/prisma/build/index.js:1413:71)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Rgt (/home/work/node_modules/.pnpm/[email protected]/node_modules/prisma/build/index.js:1892:280)
prisma:getGenerators neededVersions {} +294ms Error: Error: Expected property name or '}' in JSON at position 29
at Mf.parse (/home/work/node_modules/.pnpm/[email protected]/node_modules/prisma/build/index.js:1413:71)
Hey, at first glance, it looks like it comes from the Prisma engine. You can try removing the prisma-generator-drizzle plugin and see if the problem persists.
prisma:getGenerators neededVersions {} +294ms Error: Error: Expected property name or '}' in JSON at position 29
at Mf.parse (/home/work/node_modules/.pnpm/[email protected]/node_modules/prisma/build/index.js:1413:71)
Hey, at first glance, it looks like it comes from the Prisma engine. You can try removing the prisma-generator-drizzle plugin and see if the problem persists.
generator client {
provider = "prisma-client-js"
}
no problem
"@prisma/client": "5.10.2",
"better-sqlite3": "^9.4.3",
"drizzle-kit": "^0.20.14",
"prisma": "5.10.2",
"prisma-generator-drizzle": "^0.6.6",
"drizzle-orm": "^0.30.2",
Do you mind sending me a reproduction repo so I can take a better look?
@TenviLi this might be unrelated, could you also try using bun 1.0.30?
To install a specific version of bun, follow this step to uninstall and find the "install specific version" here.
I have the same error unfortunatly :/ (Bun 1.0.35 / Prisma 5.2.0)
If you want to test it, I can give you an example :
datasource db {
provider = "postgresql"
url = "postgresql://docker:docker@localhost:5432/project"
}
generator drizzle {
provider = "prisma-generator-drizzle"
}
model Token {
id String @id @unique @default(uuid())
refreshToken String
accessToken String
owner User @relation(fields: [ownerId], references: [id])
ownerId String
createdAt DateTime @default(now())
}
model User {
id String @id @unique @default(uuid())
tokens Token[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
@qlaffont @TenviLi It seems that the problem is arising from comments in the tsconfig.json file, as JSON does not support comments by default. I've just released version 0.6.7 to address this issue. Please give it a try and let me know if it doesn't resolve the issue.
Nop :/
> [email protected] generate /home/quentin/Documents/dev/perso/starter-api
> prisma generate
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Error:
Expected double-quoted property name in JSON at position 622
Nop :/
> [email protected] generate /home/quentin/Documents/dev/perso/starter-api > prisma generate Environment variables loaded from .env Prisma schema loaded from prisma/schema.prisma Error: Expected double-quoted property name in JSON at position 622
Do you mind to modify this repository to reproduce your error?
Strange I don't reproduce the error with deps I have installed...
Feel free to reopen if the issue persists.