Dependencies between pnpm monorepo cannot be resolved

For Workes & Pages, what is the name of the domain?

convoconvo.pages.dev

What is the error number?

TS2307

What is the error message?

error TS2307: Cannot find module ‘@convo/core’ or its corresponding type declarations.

What is the issue or error you’re encountering

The build is fine locally but not work in the build enviornment. Seems like only the subdirectory is fetched but not others, so it workspace dependencies cannot be solved.

What steps have you taken to resolve the issue?

Workaround: change code structure temporarily when pushing.

You need to build dependencies in a topological order (pnpm -r build).

See discussion here Topological parallel grouping for script execution in workspaces · Issue #7630 · pnpm/pnpm · GitHub