Prisma1: [generate] Wrong template string is generated inside prisma-client

Created on 22 Jan 2019  路  12Comments  路  Source: prisma/prisma1

Describe the bug
A clear and concise description of what the bug is. Gives an error:
Project not found: 'project$stage%7D'

To Reproduce
Steps to reproduce the behavior:
Just run the command prisma generate

Expected behavior
Should generate a proper file used in the future

Screenshots
If applicable, add screenshots to help explain your problem.

Versions (please complete the following information):

  • Connector: [Postgres]
  • Prisma Server: [1.25.0]
  • prisma CLI: [prisma/1.25.0 (darwin-x64) node-v11.7.0]
  • OS: [OS X High Sierra, Ubuntu 18.04]
  • other dependencies: prisma-client, prisma-binding

Additional context
Add any other context about the problem here.

bu2-confirmed areclienjs areclient

Most helpful comment

I'm getting a similar error. This happened after the upgrade also. It appears prisma generate is doing this:

export const Prisma = makePrismaClientClass<ClientConstructor<Prisma>>({
  typeDefs,
  models,
  endpoint: `${process.env["PRISMA_ENDPOINT"]}}`,
  secret: `${process.env["PRISMA_SECRET"]}}`
});
export const prisma = new Prisma();

should probably be:

export const Prisma = makePrismaClientClass<ClientConstructor<Prisma>>({
  typeDefs,
  models,
  endpoint: `${process.env["PRISMA_ENDPOINT"]}`,
  secret: `${process.env["PRISMA_SECRET"]}`
});
export const prisma = new Prisma();

All 12 comments

@impowski : Can you please share some more parameters, like, are you using local prisma server? and what is your datamodel.prisma file? Thanks!

@divyenduz it's hosted on DigitalOcean. I just updated to version 1.25 and that fell apart no idea why.

I'm getting a similar error. This happened after the upgrade also. It appears prisma generate is doing this:

export const Prisma = makePrismaClientClass<ClientConstructor<Prisma>>({
  typeDefs,
  models,
  endpoint: `${process.env["PRISMA_ENDPOINT"]}}`,
  secret: `${process.env["PRISMA_SECRET"]}}`
});
export const prisma = new Prisma();

should probably be:

export const Prisma = makePrismaClientClass<ClientConstructor<Prisma>>({
  typeDefs,
  models,
  endpoint: `${process.env["PRISMA_ENDPOINT"]}`,
  secret: `${process.env["PRISMA_SECRET"]}`
});
export const prisma = new Prisma();

I'm also seeing this on my Mac (Mojave) and when I fix the generated file I then get this error. https://github.com/prisma/prisma/issues/3907

updating to prisma 1.25 did the same. (adding some characters after the endpoint in prisma-client)
I downgraded to 1.20 and everything is working fine

I've meeting a similar problem after updating to 1.25.when I exec prisma deploy ,a typeerror occurs:
TypeError: Cannot read property 'steps' of null
I donno where to set the 'steps' property

@divyenduz: Seconding @parachut-daniel's observation of the extra } at the end of the lines:

endpoint: `${process.env["PRISMA_ENDPOINT"]}}`,
and
secret: `${process.env["PRISMA_SECRET"]}}`

As others have mentioned, this arises from the Prisma CLI version: prisma/1.25.0 (darwin-x64) node-v11.6.0. I'm running the Docker Hub tag prismagraphql/prisma:1.25 on the Prisma Server side, but this is clearly a CLI/codegen issue per the code highlighted above.

I'm getting a similar error. This happened after the upgrade also. It appears prisma generate is doing this:

export const Prisma = makePrismaClientClass<ClientConstructor<Prisma>>({
  typeDefs,
  models,
  endpoint: `${process.env["PRISMA_ENDPOINT"]}}`,
  secret: `${process.env["PRISMA_SECRET"]}}`
});
export const prisma = new Prisma();

should probably be:

export const Prisma = makePrismaClientClass<ClientConstructor<Prisma>>({
  typeDefs,
  models,
  endpoint: `${process.env["PRISMA_ENDPOINT"]}`,
  secret: `${process.env["PRISMA_SECRET"]}`
});
export const prisma = new Prisma();

Even when I fix the interpolation issue I get below error when the code runs

TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at Client.extractPayload (/Users/mystical/Workspace/Project/ziro/node_modules/prisma-client-lib/src/Client.ts:214:16)

@ajaymore Thanks, TypeError: Cannot convert undefined or null to object is a separate issue and is being tracked here: https://github.com/prisma/prisma/issues/3907

@ajaymore Thanks, TypeError: Cannot convert undefined or null to object is a separate issue and is being tracked here: #3907

@divyenduz Thank you, that addressed my concern. I am able to get the code running by manually changing the autogenerated template strings.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

schickling picture schickling  路  3Comments

tbrannam picture tbrannam  路  3Comments

notrab picture notrab  路  3Comments

marktani picture marktani  路  3Comments

thomaswright picture thomaswright  路  3Comments