SDK Build error - Migrating from Wasp 0.16.0 to 0.20.0
General Wasp
Hi Wasp team! I'm trying to migrate from Wasp 0.16 to 0.20 and hitting an SDK build error.
Environment: Wasp 0.20.0 Node.js 22.21.1 macOS
Error: SDK build failed with exit code: 2 error TS2307: Cannot find module 'wasp/src/features/...' or its corresponding type declarations.
The SDK generates imports like: import { generateMessage } from 'wasp/src/features/generate-message/server/actions'
But TypeScript can't resolve wasp/src/* during compilation because: package.json exports map "./src/": "./dist/src/.js" During tsc, the dist/ folder doesn't exist yet → chicken-and-egg problem
Workaround found: Adding this to .wasp/out/sdk/wasp/tsconfig.json fixes the build: "baseUrl": ".", "paths": { "wasp/src/": ["./src/"] }
Problem: This fix only works locally. On deployment (wasp build), the SDK is regenerated without the path mapping, so production builds will fail.
My project structure: Feature-first architecture with actions/queries in src/features/*/server/actions/ (standard @src/features/... imports in main.wasp).
Is this a known issue? Any workaround for production deployments?
Thanks!
Recent Announcements
Continue the conversation
Join the Discord to ask follow-up questions and connect with the community
W
Wasp
Rails-like framework for React, Node.js and Prisma. Build your app in a day and deploy it with a single CLI command.