prisma1
prisma1 copied to clipboard
prisma.yml recursive self-referencing variables issue w/ prisma generate
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:
- Using the following
prisma.ymlfile:
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
- Execute
prisma generatein 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
prismaCLI: 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.
Closing as a duplicate of #3659