I’m using turborepo with some packages and nextjs apps. After a few deploys I’ve realized this warning:
I thought, simple enough, let me follow the docs and solve it. However I don’t seem to get it right.
The first thing I don’t understand is why it says my packages (aka @repo/library) need the config since they don’t use, nor receive the variables on any shape or form.
Then I’ve tried to add the turbo config setup by extending the file since those env are app specific.
// apps/papelada
{
"extends": ["//"],
"tasks": {
"build": {
"env": [
"CLERK_SECRET_KEY ",
"WHATSAPP_VERIFY_TOKEN ",
"PAPELADA_BLOB_STORE_PROD_READ_WRITE_TOKEN ",
"CLERK_ENCRYPTION_KEY ",
"CLERK_WEBHOOK_SIGNING_SECRET ",
"PAPELADA_PRISMA_POSTGRES_POSTGRES_URL ",
"PAPELADA_PRISMA_POSTGRES_PRISMA_DATABASE_URL ",
"PAPELADA_PRISMA_POSTGRES_DATABASE_URL"
]
},
}
}
It didn’t work, but after reading more documentations I’ve learned that extending the file overrides the task completely, so I tried again:
// apps/papelada
{
"extends": ["//"],
"tasks": {
"build": {
"dependsOn": ["^build"],
"inputs": ["$TURBO_DEFAULT$", ".env*"],
"outputs": ["dist/**", ".next/**", "!.next/cache/**"],
"env": [
"CLERK_SECRET_KEY ",
"WHATSAPP_VERIFY_TOKEN ",
"PAPELADA_BLOB_STORE_PROD_READ_WRITE_TOKEN ",
"CLERK_ENCRYPTION_KEY ",
"CLERK_WEBHOOK_SIGNING_SECRET ",
"PAPELADA_PRISMA_POSTGRES_POSTGRES_URL ",
"PAPELADA_PRISMA_POSTGRES_PRISMA_DATABASE_URL ",
"PAPELADA_PRISMA_POSTGRES_DATABASE_URL"
]
},
}
}
No success, so I thought that maybe it would only work if I set the env config on the repo root turbo.config file even. though I don’t like the approach given it’s app specific. Anyhow I did:
// repo root
{
"$schema": "https://turborepo.com/schema.json",
"ui": "tui",
"tasks": {
"build": {
"dependsOn": ["^build"],
"inputs": ["$TURBO_DEFAULT$", ".env*"],
"outputs": ["dist/**", ".next/**", "!.next/cache/**"],
"env": [
"CLERK_SECRET_KEY ",
"WHATSAPP_VERIFY_TOKEN ",
"PAPELADA_BLOB_STORE_PROD_READ_WRITE_TOKEN ",
"CLERK_ENCRYPTION_KEY ",
"CLERK_WEBHOOK_SIGNING_SECRET ",
"PAPELADA_PRISMA_POSTGRES_POSTGRES_URL ",
"PAPELADA_PRISMA_POSTGRES_PRISMA_DATABASE_URL ",
"PAPELADA_PRISMA_POSTGRES_DATABASE_URL"
]
},
"lint": {
"dependsOn": ["^lint"]
},
"check-types": {
"dependsOn": ["^check-types"]
},
"dev": {
"cache": false,
"persistent": true
}
}
}
Same warnings and now I’m kinda lost. Does anyone has any ideas on what should I do?