SDK Build failing even after setting up DB commands
I'm on MacOS, wasp version: 0.16.2, Node: v20.17.0, NPM: 10.8.2
12 Replies
Hi @SilveR. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the information provided in the knowledge sources and your question, it seems you're encountering an SDK build failure with Wasp. Let's address this issue step by step:
1. Node Version Compatibility:
The error message you're seeing is not directly related to Node version, but it's worth noting that Wasp 0.16.2 may not be fully compatible with Node 20. As mentioned in this Discord thread, Wasp required Node.js 18 at the time, with plans to update the requirement to >= 18 in the future.
2. TypeScript Installation:
The error message suggests that TypeScript is not installed in your project. This is likely because TypeScript is a dev dependency, and Wasp might not be handling dev dependencies correctly during the build process. This is a known issue as described in this GitHub issue.
3. Possible Solutions:
a. Try running
wasp clean
and then wasp start
again. This solution has worked for similar issues as mentioned in this Discord thread.
b. If that doesn't work, you might need to manually install TypeScript in your project. Try running:
in your project directory, and then attempt to run wasp start
again.
c. Consider using Node.js 18 with Wasp for better compatibility. You can use nvm (Node Version Manager) to switch between Node versions easily. This is recommended in the Wasp documentation.
4. Additional Context:
The issue you're facing might be related to how Wasp handles dependencies and dev dependencies during the build process. This is an area that the Wasp team is aware of and working on improving, as evidenced by the GitHub issue linked above.
If these steps don't resolve your issue, you might want to reach out to the Wasp community on their Discord channel for more specific assistance, as the problem could be related to your particular project setup or a recent change in Wasp that isn't fully documented yet.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @SilveR, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?Same problem once I switched back to node 18, this happens at the "wasp db migrate-dev" step
@kapa.ai I’m facing this problem at the db migrate-dev step
Let me check the knowledge base for you again. One moment! :books:
----------------------
Based on the information you've provided and the context from our previous conversation, it seems you're encountering an issue during the
wasp db migrate-dev
step. Let's address this problem specifically:
1. Database Migration Issues:
The wasp db migrate-dev
command is used to apply database migrations in Wasp projects. Issues during this step can occur for various reasons, but without more specific error messages, it's challenging to pinpoint the exact cause.
2. Possible Solutions:
a. Ensure your database is running:
Before running wasp db migrate-dev
, make sure your database is up and running. You can do this by running:
in a separate terminal window and leaving it running.
b. Check for existing migrations:
If you've previously run migrations, there might be conflicts. Try running:
without any additional arguments to see if it provides more detailed error messages.
c. Verify your Prisma schema:
Ensure that your schema.prisma
file is correctly configured and doesn't contain any syntax errors.
3. Common Issues:
According to this GitHub issue, some users have encountered errors during the migration step. In one case, removing a comment from the command resolved the issue. If you're including any comments or additional arguments with your wasp db migrate-dev
command, try running it without them.
4. Version Compatibility:
Given that you're using Node v20.17.0, which is newer than the version Wasp 0.16.2 was designed for, there might be compatibility issues. As suggested in our previous conversation, consider using Node.js 18 with nvm for better compatibility with Wasp 0.16.2.
5. Additional Troubleshooting:
If the issue persists, try the following steps:
- Run wasp clean
to clear any cached data.
- Ensure all your project dependencies are correctly installed.
- Check the Wasp and Prisma logs for any specific error messages that might provide more context.
If you're still facing issues after trying these steps, it would be helpful to share the specific error message or output you're seeing when running wasp db migrate-dev
. This would allow for a more precise diagnosis of the problem.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @SilveR, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?@kapa.ai I’ve never setup this package before - this is my first time.
Let me check the knowledge base for you again. One moment! :books:
----------------------
I understand that this is your first time setting up Wasp. In that case, let's go through the initial setup process for a Wasp project, focusing on the database migration step. Here's what you need to do:
1. Initial Setup:
First, make sure you have Wasp installed. If not, you can follow the installation instructions in the Wasp documentation.
2. Create a New Wasp Project:
If you haven't already, create a new Wasp project using:
3. Database Setup:
By default, Wasp uses SQLite for development. For your first setup, you don't need to change anything in the database configuration.
4. Run Database Migration:
Now, you need to run the database migration. This is where you were encountering issues. Here's what to do:
a. First, make sure your database is running:
Leave this terminal window open.
b. In a new terminal window, navigate to your project directory and run:
This command should create your initial database schema based on your Wasp project's entity definitions.
5. Common First-Time Setup Issues:
According to this GitHub issue, first-time users often forget to run
wasp db migrate-dev
. Wasp has improved its error messages to guide users better, but it's still a crucial step.
6. If You Encounter Issues:
If you face any problems during the wasp db migrate-dev
step:
- Make sure you're running the latest version of Wasp.
- Check that your main.wasp
file has the correct database configuration.
- Ensure you have the necessary permissions to create and modify the database file.
7. Next Steps:
After successfully running the migration, you can start your Wasp app with:
Remember, if you encounter any specific error messages during this process, it would be helpful to share them for more targeted assistance. The Wasp community is also very supportive, and you can always seek help on their Discord channel if you run into any issues.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @SilveR, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?@SilveR what happens if you use node version 18 ?
are you on a macbook m1?
if so, check the note here https://wasp.sh/docs/quick-start#installation-1
Quick Start | Wasp
Installation
since it's a typescript error, maybe @Filip has an idea what;s going on here.
Hey @SilveR, seems like you somehow ended up with the wrong
tsc
package. Do you mind sharing your project's zip so I can investigate?I got it! I just needed to install the right tsc package and then run source ~/.zshrc
Hey @SilveR, I think you're doing something wrong 😅
You shouldn't be installing tsc of any kind globally to work with Wasp, nor putting it in your
.zshrc
.
Wasp will install its own tsc
in the project's node_modulesSo this may or may not be helpful, but I’ve encountered this same error; I think when I started experimenting with the new TS config.
I found that I needed to run
npm install
after wasp clean
to ensure everything works correctly when Wasp compiles the project, e.g.:
I’m also on macOS, running Node v23