prisma-erd-generator: Error: could not parse datamodel

I have a recent schema (39 models) created via db pull with 3.4.2. Unfortunately no svg is created and with DEBUG=* I see this error message:

  prisma:GeneratorProcess Error: could not parse datamodel +463ms
  prisma:GeneratorProcess     at Object.exports.default [as onGenerate] (C:\Users\Jan\Documents\throwaway\cloud-api\node_modules\prisma-erd-generator\dist\generate.js:146:19) +1ms
  prisma:GeneratorProcess     at processTicksAndRejections (internal/process/task_queues.js:95:5) +0ms
  prisma:GeneratorProcess     at async LineStream.<anonymous> (C:\Users\Jan\Documents\throwaway\cloud-api\node_modules\@prisma\generator-helper\dist\generatorHandler.js:36:24) +1ms

What is the best way to debug this?

(I unfortunately can not share the schema here)

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 23 (7 by maintainers)

Commits related to this issue

Most upvoted comments

I had the same problem. “Error: could not parse datamodel”. I solved that with a simple solution above.

My directory to the folder project was:

- D:\\Projetos\\Projetos Gerais\\fullcycle-prisma\\node_modules\\prisma\\query-engine-windows.exe

Pay attention that “Projetos Gerais” has a blank space

My solution was replace that space to “_”.

- Projetos Gerais
+ Projetos_Gerais

Fixed directory

+ D:\\Projetos\\Projetos_Gerais\\fullcycle-prisma\\node_modules\\prisma\\query-engine-windows.exe

After that, the error was solved for me. I hope this can help someone.

i had the same issue and solved with

I had the same problem. “Error: could not parse datamodel”. I solved that with a simple solution above.

My directory to the folder project was:

- D:\\Projetos\\Projetos Gerais\\fullcycle-prisma\\node_modules\\prisma\\query-engine-windows.exe

Pay attention that “Projetos Gerais” has a blank space

My solution was replace that space to “_”.

- Projetos Gerais
+ Projetos_Gerais

Fixed directory

+ D:\\Projetos\\Projetos_Gerais\\fullcycle-prisma\\node_modules\\prisma\\query-engine-windows.exe

After that, the error was solved for me. I hope this can help someone.

I had the same issue and your tip solved my problem. I really appreciate

The change of the spaces from folders work for me too, thanks! 😃