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

@default([]) will crash the generator #68

Closed
KuhlTime opened this issue Apr 6, 2023 · 2 comments
Closed

@default([]) will crash the generator #68

KuhlTime opened this issue Apr 6, 2023 · 2 comments

Comments

@KuhlTime
Copy link

KuhlTime commented Apr 6, 2023

First of all thanks for your amazing work! 🫶

Once you have time maybe you can take a look at the @default([]) attribute. The generator seems to crash for me everytime I am enabling it. This is the prisma Schema that I used:

model Person {
  id			String		@id @db.Uuid
  first_name	String		@db.VarChar(50)
  last_name		String		@db.VarChar(50)
  emails		String[]	@default([]) @db.VarChar(320)

  @@map("person")
}

Here is the error log from what Prisma outputted running pnpx prisma generate.

Error Log
> prisma generate

  prisma:engines  binaries to download libquery-engine, migration-engine +0ms
  prisma:loadEnv  project root found at ./package.json +0ms
  prisma:tryLoadEnv  Environment variables loaded from ./.env +0ms
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
  prisma:getConfig  Using getConfig Wasm +0ms
  prisma:getConfig  config data retrieved without errors in getConfig Wasm +2ms
  prisma:getDMMF  Using getDmmf Wasm +0ms
  prisma:getDMMF  Using given datamodel +0ms
  prisma:getDMMF  dmmf data retrieved without errors in getDmmf Wasm +29ms
  prisma:generator  prismaCLIDir./node_modules/prisma +0ms
  prisma:generator  prismaClientDir ./node_modules/@prisma/client +0ms
  prisma:generator  baseDir ./prisma +0ms
  prisma:generator  typescriptPath ./node_modules/.pnpm/typescript@5.0.3/node_modules/typescript +1ms
  prisma:GeneratorProcess  2023-04-06T15:40:51.169Z prisma:client:generator  requiredEngine: libqueryEngine +0ms
  prisma:getGenerators  neededVersions {
  "659ef412370fa3b41cd7bf6e94587c1dfb7f67e7": {
    "engines": [
      "libqueryEngine"
    ],
    "binaryTargets": []
  }
} +0ms
  prisma:getGenerators  {
  generatorBinaryPaths: {
    libqueryEngine: {
      'darwin-arm64': './node_modules/.pnpm/prisma@4.12.0/node_modules/prisma/libquery_engine-darwin-arm64.dylib.node'
    }
  }
} +25ms
  prisma:GeneratorProcess  2023-04-06T15:40:51.229Z prisma:loadEnv  project root found at ./package.json +58ms
  prisma:GeneratorProcess  Error: unable to write files for Prisma Docs Generator +83ms
Error: Error: 
✔ Generated Prisma Client (4.12.0 | library) to ./node_modules/.pnpm/@prisma+client@4.12.0_prisma@4.12.0/node_modules/@prisma/client in 83ms

Cannot read properties of undefined (reading 'join')
    at _Generate.parse (./node_modules/.pnpm/prisma@4.12.0/node_modules/prisma/build/index.js:101892:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async main (./node_modules/.pnpm/prisma@4.12.0/node_modules/prisma/build/index.js:103530:18)

Environment:

  • OS: macOS 13.1 (22C65)
  • node.js: v19.3.0
  • Prisma: v4.12.0
  • primsa-docs-generator: v0.6.0
@pantharshit00
Copy link
Owner

pantharshit00 commented Apr 11, 2023

Hello @KuhlTime

Thanks for reporting this. I just released a fix for this in v0.7.0. Please let me know if this is now addressed.

@KuhlTime
Copy link
Author

Amazing thank you so much @pantharshit00

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

2 participants