Help: Could not find package "db" from task "db#migrate" in project #8433
Replies: 4 comments
-
|
Removing the " |
Beta Was this translation helpful? Give feedback.
-
|
Would love some clarification on this issue! Especially since the docs recommend usage of using |
Beta Was this translation helpful? Give feedback.
-
|
Hey! I've since become a lot better at Turbo. Before, I didn't really understand the relationship between tasks explicitly defined in {
// ...
"dev": {
"cache": false,
"persistent": true,
"dependsOn": [
"^migrate"
]
}
}One behavior I'd really like that isn't currently possible within Turbo (and this is more of a feature request, so I'll likely bootstrap another discussion post with this): When running package-filtered pnpm commands in a pnpm workspace, you don't need to add the namespace name in your filter for pnpm to resolve the underlying package. Example: if you have a package named To do the same with turbo, you need to explicitly add the namespace (i.e. At the end of the day this is (at best) a minor quality of life feature and I assume that the turborepo maintainers don't want to explicitly adopt pnpm workspace behavior (I'm not even sure how pnpm handles this when multiple namespaces are present within a pnpm workspace). |
Beta Was this translation helpful? Give feedback.
-
|
What solved my issue was adding a turbo.jsonc in the package that had the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Hi all,
I'm using
[email protected]and[email protected]in a personal turborepo project. I'm still fairly noob at turbo (we use it internally at work) and I'm having trouble figuring out some discrepancies between how our work monorepos and my personal monorepo are being resolved. I have the following apps and packages:When I run
pnpm dev(akapnpm turbo run dev) I get the following error:I've attached my
turbo.jsonand other relevantpackage.jsons below. In my work monorepos, using packages/ package scripts without their namespace (e.g. using justdbinstead of@repo/dbis honored withinturbo.json. However, that doesn't seem to be the case in my personal turborepo. Was there some breaking change in Turborepo's behavior in any recent updates for this? Or am I doing something wrong in the setup of my packages? Please let me know what additional info I could provide here that would help debug.Additional information
Root package.json:
{ "name": "turborepo", "namespace": "@repo", "packageManager": "[email protected]", "private": true, "scripts": { "build": "turbo build", "dev": "turbo dev", "lint": "turbo lint", "prepare": "husky", "commitlint": "commitlint --edit" }, "devDependencies": { "@commitlint/cli": "^19.3.0", "@commitlint/config-conventional": "^19.2.2", "@repo/typescript-config": "workspace:*", "commitlint": "^19.3.0", "husky": "^9.0.11", "prettier": "^3.2.5", "turbo": "latest" }, "engines": { "node": ">=18" }, "pnpm": { "peerDependencyRules": { "allowedVersions": { "eslint": "9" } } } }dbpackage package.json:{ "name": "@repo/db", "version": "1.0.0", "main": "./src/index.ts", "types": "./src/index.ts", "scripts": { "generate": "prisma generate", "migrate": "prisma migrate dev", "migrate:dev": "prisma migrate dev", "seed": "prisma db seed", "dev": "echo 'Add dev script here'", "build": "echo 'Add build script here'", "test": "echo 'Add test script here'", "lint": "echo 'Add lint script here'" }, "devDependencies": { "@repo/typescript-config": "workspace:*", "prisma": "^5.15.0", "tsx": "^4.11.0", "zod-prisma-types": "^3.1.8" }, "dependencies": { "@prisma/client": "^5.15.0", "prisma-extension-caching": "^1.0.9", "zod": "^3.23.8" }, "prisma": { "schema": "prisma/schema.prisma", "seed": "tsx prisma/seed" } }turbo.json:{ "$schema": "https://turbo.build/schema.json", "globalDependencies": [ "**/.env.*local" ], "globalEnv": [ "DATABASE_URL", "NODE_ENV", "PACKAGE_VERSION" ], "globalPassThroughEnv": [ "NODE_ENV" ], "tasks": { "build": { "dependsOn": [ "^build" ], "outputs": [ ".next/**", "!.next/cache/**" ] }, "lint": { "dependsOn": [ "^lint" ] }, "migrate": { "cache": true, "persistent": false }, "dev": { "cache": false, "persistent": true, "dependsOn": [ "db#migrate" ] } } }pnpm-workspace.yaml:Beta Was this translation helpful? Give feedback.
All reactions