Error when generating - Cannot read property 'map' of undefined
Closed this issue ยท 3 comments
MartinMuzatko commented
Right now, I get an error when trying to use the json schema generator.
I am using:
prisma: ^3.9.1
typescript: ^4.4.4
nodejs: v14.17.6
My Prisma Schema:
generator client {
provider = "prisma-client-js"
}
generator jsonSchema {
provider = "prisma-json-schema-generator"
}
datasource db {
provider = "mysql"
url = env("DB_URL")
}
model Event {
id Int @id @default(autoincrement()) @map("ID")
timestampAppears DateTime? @map("TimestampAPPEARS") @db.Timestamp(3)
}
The error I am facing:
It looks like dmff.types
is undefined
.
TypeError: Cannot read property 'map' of undefined
at Object.transformDMMF (/home/martin/dev/sicongitlab/sicon/modules/db/node_modules/prisma-json-schema-generator/dist/generator/transformDMMF.js:28:38)
at Object.onGenerate (/home/martin/dev/sicongitlab/sicon/modules/db/node_modules/prisma-json-schema-generator/dist/index.js:36:48)
at LineStream.<anonymous> (/home/martin/dev/sicongitlab/sicon/modules/db/node_modules/prisma-json-schema-generator/node_modules/@prisma/generator-helper/dist/generatorHandler.js:36:38)
at LineStream.emit (events.js:400:28)
at addChunk (internal/streams/readable.js:290:12)
at readableAddChunk (internal/streams/readable.js:265:9)
at LineStream.Readable.push (internal/streams/readable.js:204:10)
at LineStream.Transform.push (internal/streams/transform.js:166:32)
at LineStream._pushBuffer (/home/martin/dev/sicongitlab/sicon/modules/db/node_modules/prisma-json-schema-generator/node_modules/@prisma/generator-helper/dist/byline.js:104:17)
at LineStream._transform (/home/martin/dev/sicongitlab/sicon/modules/db/node_modules/prisma-json-schema-generator/node_modules/@prisma/generator-helper/dist/byline.js:98:8)
valentinpalkovic commented
@MartinMuzatko Thank you for reporting this! Hotfix release is on its way!
github-actions commented
๐ This issue has been resolved in version 2.0.8 ๐
The release is available on:
Your semantic-release bot ๐ฆ๐
MartinMuzatko commented
Thank you for the quick fix :)