[Previous content remains the same...]
Error: Cannot find module '@repo/utils'
Solutions:
- Verify workspace setup:
# pnpm-workspace.yaml packages: - 'apps/*' - 'packages/*'
- Check package names match in package.json:
{ "dependencies": { "@repo/utils": "workspace:*" } }
# Clean everything
rm -rf node_modules
rm -rf apps/*/node_modules
rm -rf packages/*/node_modules
pnpm store prune
# Reinstall everything
pnpm install
Failed to compile.
Error: Error: Cannot find module 'tsup/dist/cli-default.js'
Solutions:
- Check tsup is installed:
pnpm add -D tsup
- Verify tsup.config.ts is in the correct location:
// apps/server/tsup.config.ts import { defineConfig } from "tsup"; export default defineConfig({ entry: ["./src/index.ts"], noExternal: ["@repo"], // ... other config });
Error: Failed to compile: Module not found: Can't resolve '@repo/ui'
Solutions:
- Verify next.config.js setup:
/** @type {import('next').NextConfig} */ const nextConfig = { transpilePackages: ["@repo/**"], }; module.exports = nextConfig;
- Check package dependencies:
{ "dependencies": { "@repo/ui": "workspace:*", "next": "latest", "react": "^18" } }
ERR_PNPM_OUTDATED_LOCKFILE
Solutions:
- Update .npmrc configuration:
node-linker=hoisted shared-workspace-lockfile=true strict-peer-dependencies=false auto-install-peers=true
- Force update lockfile:
pnpm install --force
Error: listen EADDRINUSE: address already in use :::3000
Solutions:
- Check if ports are in use:
# Windows netstat -ano | findstr :3000 # Linux/Mac lsof -i :3000
- Configure different ports:
# .env PORT=3001
Solutions:
- Verify tsconfig.json setup:
{ "compilerOptions": { "baseUrl": ".", "paths": { "@repo/*": ["packages/*/src"] } } }
- Check packages are included in tsconfig:
{ "include": ["src", "../../packages/*/src"] }
-
Clean Start
# Clean everything and start fresh pnpm clean rm -rf node_modules pnpm install pnpm build pnpm dev
-
Debugging Build Issues
# Build with verbose logging DEBUG=* pnpm build # Build specific app pnpm build --filter=server
-
Package Management
# Add dependency to specific app pnpm add package-name --filter app-name # Add shared dependency to workspace pnpm add package-name -w
Ensure your environment is properly configured:
node -v # Should be >=18.0.0
pnpm -v # Should be >=8.0.0
Required files in root:
pnpm-workspace.yaml
turbo.json
.npmrc
package.json
- Check the Turborepo documentation
- Verify all packages have correct peer dependencies
- Try running apps individually to isolate issues
- Check for conflicting dependency versions
- Ensure all required environment variables are set
[Your contribution guidelines here]
[Your license information here]