prisma1 icon indicating copy to clipboard operation
prisma1 copied to clipboard

prisma.yml recursive self-referencing variables issue w/ prisma generate

Open jwondrusch opened this issue 7 years ago • 1 comments

Describe the bug Getting started with Prisma and ran into an issue when trying to use recursive self references in my prisma.yml config file.

To Reproduce Steps to reproduce the behavior:

  1. Using the following prisma.yml file:
endpoint: http://localhost:4466/{self:custom.serviceName}/${self:custom.stage}
datamodel: datamodel.prisma

generate:
  - generator: typescript-client
    output: ./generated/prisma-client/
hooks:
  post-deploy:
      - prisma generate
      - npx nexus-prisma-generate --client ./generated/prisma-client --output ./generated/nexus-prisma

custom:
  serviceName: test
  stage: dev
  1. Execute prisma generate in my terminal will eventually throw the following error:
 â–¸    '}' expected. (690:138)
 â–¸    688 | */
 â–¸    689 |
 â–¸    > 690 | export const Prisma =
 â–¸    makePrismaClientClass<ClientConstructor<Prisma>>({typeDefs, models,
 â–¸    endpoint: `http://localhost:4466//${self:custom.serviceName}/${self:custom.stage}`})
 â–¸    |
 â–¸    ^
 â–¸    691 | export const prisma = new Prisma()
 â–¸    692 |

Expected behavior App deploys using self-referencing variables.

Screenshots N/a

Versions (please complete the following information):

  • Connector: Postgres
  • Prisma Server: 1.34
  • prisma CLI: 1.34
  • OS: Ubuntu 16.04`

Additional context Pretty barebones, just following along with the docs (only users + posts schemas). Using environment variables works fine, it's just the self-referencing ones that fail. Looks like the self-referencing variables are not parsed before generating the file, but they are for environment vars.

jwondrusch avatar Jun 22 '19 20:06 jwondrusch

Closing as a duplicate of #3659

pantharshit00 avatar Jul 01 '19 12:07 pantharshit00