W
Wasp-lang4mo ago
ArDev

type declarations

Cannot find module 'wasp/client/router' or its corresponding type declarations.ts(2307) how do i download the type declarations
57 Replies
kapa.ai
kapa.ai4mo ago
Hi @ArDev. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- The error message you're seeing typically occurs when the Wasp compiler hasn't been run or something has gone wrong during the compilation process. The Wasp compiler generates the necessary wasp/* packages, including wasp/client/router, which includes the type declarations you need. Here are a few steps you can try to resolve this issue: 1. Check your Wasp version with wasp version. Make sure it's up to date. 2. Try running the Wasp compiler with wasp start. This should generate the necessary wasp/* packages. 3. If the error persists, you might need to clean your Wasp project. You can do this by running wasp clean. This command deletes all .wasp and node_modules files. After running wasp clean, try running wasp start again to reinstall everything. If none of these steps resolve your issue, it might be helpful to provide more information about your project setup or any specific steps you took before encountering this error. Sources: - Discord support thread: Hey! Any ideas on some solutions to these errors? > Answers (https://discord.com/channels/686873244791210014/1215750573278629958) - Docs > Advanced > Type-Safe Links > API Reference > routes Object (https://wasp-lang.dev/docs/advanced/links#routes-object) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @ArDev, 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?
miho
miho4mo ago
Can you share some details about your setup: your OS, how did you create your project and what commands did you run?
ArDev
ArDev4mo ago
@kapa.ai Cannot find module 'wasp/entities' or its corresponding type declarations.ts(23) this is in opensaas
kapa.ai
kapa.ai4mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- The error message you're seeing typically occurs when the Wasp compiler hasn't been run or something has gone wrong during the compilation process. The Wasp compiler generates the necessary wasp/* packages, including wasp/entities, which includes the type declarations you need. Here are a few steps you can try to resolve this issue: 1. Check your Wasp version with wasp version. Make sure it's up to date. 2. Try running the Wasp compiler with wasp start. This should generate the necessary wasp/* packages. 3. If the error persists, you might need to clean your Wasp project. You can do this by running wasp clean. This command deletes all .wasp and node_modules files. After running wasp clean, try running wasp start again to reinstall everything. If none of these steps resolve your issue, it might be helpful to provide more information about your project setup or any specific steps you took before encountering this error. Sources: - Discord support thread: Hey! Any ideas on some solutions to these errors? > Answers (https://discord.com/channels/686873244791210014/1215750573278629958) - Docs > Advanced > Type-Safe Links > API Reference > routes Object (https://wasp-lang.dev/docs/advanced/links#routes-object) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
ArDev
ArDev4mo ago
@kapa.ai error: database "OpenSaaS-ceab7ead0a" does not exist [ Server!] at /mnt/d/AI Projects/aiwrapper1/app/node_modules/pg-pool/index.js:45:11 [ Server!] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [ Server!] at async Db.executeSql (/mnt/d/AI Projects/aiwrapper1/app/node_modules/pg-boss/src/db.js:28:14) [ Server!] at async Contractor.isInstalled (/mnt/d/AI Projects/aiwrapper1/app/node_modules/pg-boss/src/contractor.js:32:20) [ Server!] at async Contractor.start (/mnt/d/AI Projects/aiwrapper1/app/node_modules/pg-boss/src/contractor.js:37:23) [ Server!] at async PgBoss.start (/mnt/d/AI Projects/aiwrapper1/app/node_modules/pg-boss/src/index.js:103:5) [ Server!] at startPgBoss (/mnt/d/AI Projects/aiwrapper1/app/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts:63:5) [ Server!] at startServer (/mnt/d/AI Projects/aiwrapper1/app/.wasp/out/server/src/server.ts:14:3) { [ Server!] length: 105, [ Server!] severity: 'FATAL', [ Server!] code: '3D000', [ Server!] detail: undefined, [ Server!] hint: undefined, [ Server!] position: undefined, [ Server!] internalPosition: undefined, [ Server!] internalQuery: undefined, [ Server!] where: undefined, [ Server!] schema: undefined, [ Server!] table: undefined, [ Server!] column: undefined, [ Server!] dataType: undefined, [ Server!] constraint: undefined, [ Server!] file: 'postinit.c', [ Server!] line: '1019', [ Server!] routine: 'InitPostgres' [ Server!] } [ Server ] Server listening on port 3001 [ Server!] node:internal/process/promises:288 [ Server!] triggerUncaughtException(err, true /* fromPromise */); [ Server!] ^ [ Server!] [ Server!] [UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<PgBoss>".] { [ Server!] code: 'ERR_UNHANDLED_REJECTION' [ Server!] } [ Server!] [ Server!] Node.js v18.20.3 [ Server ] [nodemon] app crashed - waiting for file changes before starting...
kapa.ai
kapa.ai4mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- The error message you're seeing suggests that the PostgreSQL database "OpenSaaS-ceab7ead0a" does not exist. This could be due to a few reasons: 1. The database was not created: Ensure that you have run the necessary commands to create the database. In the context of Wasp, this is usually done with the wasp db migrate-dev command. 2. The database name is incorrect: Double-check the database name in your Wasp project configuration. Make sure it matches the name of the database you've created. 3. Connection issues: There might be issues with how your application is trying to connect to the database. Ensure that the database is running and that the connection parameters (host, port, username, password) are correct. As for the UnhandledPromiseRejection error, it's generally a good practice to always handle promises with a .catch() block to handle any errors that might occur. This can help prevent unhandled promise rejections which can lead to application crashes. Unfortunately, without more information about your project setup or the specific steps you took before encountering this error, it's hard to provide a more specific solution. If none of the above suggestions help, please provide more details about your issue. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @ArDev, 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?
ArDev
ArDev4mo ago
@kapa.ai how can i manually install the dependencies?
kapa.ai
kapa.ai4mo ago
Let me check the knowledge base for you. One moment! :books:
MEE6
MEE64mo ago
Wohooo @ArDev, you just became a Waspeteer level 1!
kapa.ai
kapa.ai4mo ago
---------------------- To manually install the dependencies in a Wasp project, you need to navigate to the appropriate directories and run npm install. Here are the steps: 1. Run the wasp compile command. This is an internal command that won't start the project but will generate the necessary files. 2. Navigate to the .wasp/out/web-app directory and run npm install there.
cd .wasp/out/web-app
npm install
cd .wasp/out/web-app
npm install
3. Navigate to the .wasp/out/server directory and run npm install there.
cd ../server
npm install
cd ../server
npm install
These steps simulate what Wasp usually does on its own. By running them manually, you might see more detailed error messages if something goes wrong. Source: Discord support thread: OpenSaas setup 'Role postgres does not exist' > Answers Part 2 (https://discord.com/channels/686873244791210014/1213593156646604820) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @ArDev, 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?
ArDev
ArDev4mo ago
im talking about the type declarations @kapa.ai
kapa.ai
kapa.ai4mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- The type declarations in Wasp are automatically generated when you run the Wasp compiler with wasp start. These type declarations are part of the wasp/* packages that the compiler generates, and they are based on the declarations in your Wasp files. If you're seeing errors related to these type declarations, it's likely that the Wasp compiler hasn't been run or something has gone wrong during the compilation process. Unfortunately, there isn't a way to manually install these type declarations. They are an integral part of the Wasp compiler's output and are tightly coupled to your Wasp project's specific configuration and code. If you're having trouble with these type declarations, I would recommend trying the following steps: 1. Run wasp start to start the Wasp compiler. This should generate the necessary wasp/* packages, including the type declarations. 2. If the error persists, try cleaning your Wasp project with wasp clean. This command deletes all .wasp and node_modules files. After running wasp clean, try running wasp start again. If none of these steps resolve your issue, it might be helpful to provide more information about your project setup or any specific steps you took before encountering this error. Sources: - Discord support thread: Hey! Any ideas on some solutions to these errors? > Answers (https://discord.com/channels/686873244791210014/1215750573278629958) - Docs > Advanced > Type-Safe Links > API Reference > routes Object (https://wasp-lang.dev/docs/advanced/links#routes-object) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @ArDev, 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?
ArDev
ArDev4mo ago
2024-07-09 18:07:21.369 UTC [34] FATAL: database "OpenSaaS-ceab7ead0a" does not exist @kapa.ai
kapa.ai
kapa.ai4mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- The error message you're seeing suggests that the PostgreSQL database "OpenSaaS-ceab7ead0a" does not exist. This could be due to a few reasons: 1. The database was not created: Ensure that you have run the necessary commands to create the database. In the context of Wasp, this is usually done with the wasp db migrate-dev command. 2. The database name is incorrect: Double-check the database name in your Wasp project configuration. Make sure it matches the name of the database you've created. 3. Connection issues: There might be issues with how your application is trying to connect to the database. Ensure that the database is running and that the connection parameters (host, port, username, password) are correct. Unfortunately, without more information about your project setup or the specific steps you took before encountering this error, it's hard to provide a more specific solution. If none of the above suggestions help, please provide more details about your issue. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @ArDev, 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?
ArDev
ArDev4mo ago
Windows using Cursor ide, did every command mentioned in the opensaas docs for installation @kapa.ai what cna i do?
kapa.ai
kapa.ai4mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- Based on the error message you're seeing, it seems like the PostgreSQL database "OpenSaaS-ceab7ead0a" does not exist. Here are some steps you can take to resolve this issue: 1. Create the database: In the context of Wasp, you can usually do this with the wasp db migrate-dev command. This command creates the database and applies any pending migrations. 2. Check the database name: Make sure the database name in your Wasp project configuration matches the name of the database you've created. 3. Check your database connection: Ensure that the database is running and that the connection parameters (host, port, username, password) are correct. 4. Check Docker permissions: If you're using Docker, make sure it's set up properly. You might need to follow this guide: Manage Docker as a non-root user (https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user) 5. Clean and restart your Wasp project: If none of the above steps work, you can try cleaning your Wasp project with wasp clean. This command deletes all .wasp and node_modules files. After running wasp clean, try running wasp start again. If none of these steps resolve your issue, it might be helpful to provide more information about your project setup or any specific steps you took before encountering this error. Sources: - Discord support thread: Cant start database docker is not working on wsl properly > Answers Part 6 (https://discord.com/channels/686873244791210014/1194876839911510046) - Discord support thread: [SOLVED] OpenSaaS installation docker and db issue > Answers (https://discord.com/channels/686873244791210014/1193138068195119104) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @ArDev, 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?
ArDev
ArDev4mo ago
@kapa.ai how do i fix this issue import { cn } from '../../shared/utils';
kapa.ai
kapa.ai4mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- The error you're seeing might be due to incorrect import paths. In Wasp, the @shared alias is used to import shared code between the server and the client. However, it seems like this alias was not converted correctly in some cases, as mentioned in this Discord support thread (https://discord.com/channels/686873244791210014/1215383457392238662). To fix this issue, you should replace ../../shared/utils with @shared/utils in your import statement:
import { cn } from '@shared/utils';
import { cn } from '@shared/utils';
If this doesn't resolve your issue, please provide more information about your project setup or the specific steps you took before encountering this error. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @ArDev, 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?
ArDev
ArDev4mo ago
@kapa.ai how do i fix this issue - Cannot find module 'wasp/client/router' or its corresponding type declarations.ts(2307)
kapa.ai
kapa.ai4mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- The error message you're seeing typically occurs when the Wasp compiler hasn't been run or something has gone wrong during the compilation process. The Wasp compiler generates the necessary wasp/* packages, including wasp/client/router, which includes the type declarations you need. Here are a few steps you can try to resolve this issue: 1. Check your Wasp version with wasp version. Make sure it's up to date. 2. Try running the Wasp compiler with wasp start. This should generate the necessary wasp/* packages. 3. If the error persists, you might need to clean your Wasp project. You can do this by running wasp clean. This command deletes all .wasp and node_modules files. After running wasp clean, try running wasp start again to reinstall everything. If none of these steps resolve your issue, it might be helpful to provide more information about your project setup or any specific steps you took before encountering this error. Sources: - Discord support thread: Hey! Any ideas on some solutions to these errors? > Answers (https://discord.com/channels/686873244791210014/1215750573278629958) - Docs > Advanced > Type-Safe Links > API Reference > routes Object (https://wasp-lang.dev/docs/advanced/links#routes-object) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @ArDev, 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?
ArDev
ArDev4mo ago
it still cannot see the wasp types @kapa.ai
kapa.ai
kapa.ai4mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- If you're still having trouble with Wasp not being able to find the type declarations, it might be due to a more complex issue. Here are a few additional steps you can try: 1. Check your project structure: Make sure your Wasp project structure is correct and that all necessary files are in the right place. The Wasp compiler relies on a specific project structure to generate the wasp/* packages. 2. Check your Wasp code: Errors in your Wasp code could prevent the compiler from generating the wasp/* packages correctly. Make sure all your Wasp code is correct and try running the compiler again. 3. Reinstall Wasp: If none of the above steps work, you might need to reinstall Wasp. You can do this by first uninstalling Wasp with npm uninstall -g wasp, and then reinstalling it with npm install -g wasp. 4. Reach out to the Wasp community: If you're still having trouble, you might want to reach out to the Wasp community for help. You can do this through the Wasp Discord server (https://discord.com/channels/686873244791210014/1215750573278629958) or by opening an issue on the Wasp GitHub repository (https://github.com/wasp-lang/wasp). Remember, the type declarations are an integral part of the Wasp compiler's output and are tightly coupled to your Wasp project's specific configuration and code. If you're having trouble with these type declarations, it's likely that there's an issue with your project setup or the Wasp compiler itself. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @ArDev, 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?
ArDev
ArDev4mo ago
could it do with my bashrc file @kapa.ai
kapa.ai
kapa.ai4mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- The .bashrc file is used to configure your shell session, including setting environment variables and defining shell functions. It's unlikely that this file would directly affect the generation of type declarations in a Wasp project. However, if your PATH environment variable isn't correctly configured in your .bashrc file, it could potentially cause issues with running the Wasp compiler. The PATH environment variable is used by your shell to determine where to look for executable files, so if Wasp isn't installed in a directory listed in your PATH, your shell won't be able to find and run the Wasp compiler. You can check if this is the issue by running echo $PATH in your shell. This will print out the directories listed in your PATH environment variable. If the directory where Wasp is installed isn't listed, you'll need to add it. Here's how you can add a directory to your PATH in your .bashrc file: 1. Open your .bashrc file in a text editor. 2. Add the following line at the end of the file, replacing /path/to/wasp with the actual directory where Wasp is installed:
export PATH=$PATH:/path/to/wasp
export PATH=$PATH:/path/to/wasp
3. Save the changes and close the file. 4. Reload your .bashrc file by running source ~/.bashrc in your shell. After doing this, try running the Wasp compiler again with wasp start to see if the issue is resolved. Sources: - Discord support thread: Getting started with Wasp on Terminal > Answers (https://discord.com/channels/686873244791210014/1197959724218466456) - Github Issue (closed): Update wasp completion help to mention .zshrc for MacOS > Original post (https://github.com/wasp-lang/wasp/issues/948) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @ArDev, 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?
ArDev
ArDev4mo ago
@kapa.ai how to install the types in a new opensaas project
kapa.ai
kapa.ai4mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- When you create a new OpenSaaS project with Wasp, the necessary type declarations should be automatically generated when you run the Wasp compiler with wasp start. These type declarations are part of the wasp/* packages that the compiler generates, and they are based on the declarations in your Wasp files. Here are the steps to create a new OpenSaaS project and install the types: 1. Create a new OpenSaaS project with the following command:
wasp new <project-name> -t saas
wasp new <project-name> -t saas
Replace <project-name> with the name of your project. 2. Navigate to your new project directory:
cd <project-name>
cd <project-name>
3. Start the Wasp compiler:
wasp start
wasp start
This command starts the Wasp development server and also triggers the Wasp compiler, which generates the necessary wasp/* packages, including the type declarations. If you're seeing errors related to these type declarations, it's likely that the Wasp compiler hasn't been run or something has gone wrong during the compilation process. In that case, you might need to clean your Wasp project with wasp clean and then run wasp start again. Sources: - Docs > General > CLI Reference > Commands > Creating a New Project (https://wasp-lang.dev/docs/general/cli#creating-a-new-project) - Docs > Project > Starter Templates > Available Templates (https://wasp-lang.dev/docs/project/starter-templates#available-templates) - Discord support thread: Hey! Any ideas on some solutions to these errors? > Answers (https://discord.com/channels/686873244791210014/1215750573278629958) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @ArDev, 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?
martinsos
martinsos4mo ago
@ArDev that hsould all be working for you out of the box, no need to install anything. Try doing wasp clean and then wasp start again, maybe something got messed up. How did you create a new project, and did you have it working at any point? What changed if that is so? ANy extra info you can give, helps.
ArDev
ArDev4mo ago
@kapa.ai pg-boss failed to start! [ Server!] error: database "OpenSaaS-ceab7ead0a" does not exist [ Server!] at /mnt/d/AI Projects/aiwrapper1/app/node_modules/pg-pool/index.js:45:11 [ Server!] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [ Server!] at async Db.executeSql (/mnt/d/AI Projects/aiwrapper1/app/node_modules/pg-boss/src/db.js:28:14)
[ Server!] at async Contractor.isInstalled (/mnt/d/AI Projects/aiwrapper1/app/node_modules/pg-boss/src/contractor.js:32:20) [ Server!] at async Contractor.start (/mnt/d/AI Projects/aiwrapper1/app/node_modules/pg-boss/src/contractor.js:37:23) [ Server!] at async PgBoss.start (/mnt/d/AI Projects/aiwrapper1/app/node_modules/pg-boss/src/index.js:103:5)
[ Server!] at startPgBoss (/mnt/d/AI Projects/aiwrapper1/app/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts:63:5) [ Server!] at startServer (/mnt/d/AI Projects/aiwrapper1/app/.wasp/out/server/src/server.ts:14:3) { [ Server!] length: 105, [ Server!] severity: 'FATAL', [ Server!] code: '3D000', [ Server!] detail: undefined, [ Server!] hint: undefined, [ Server!] position: undefined, [ Server!] internalPosition: undefined, [ Server!] internalQuery: undefined, [ Server!] where: undefined, [ Server!] schema: undefined, [ Server!] table: undefined, [ Server!] column: undefined, [ Server!] dataType: undefined, [ Server!] constraint: undefined, [ Server!] file: 'postinit.c', [ Server!] line: '1019', [ Server!] routine: 'InitPostgres' [ Server!] } [ Server ] Server listening on port 3001 [ Server!] node:internal/process/promises:288 [ Server!] triggerUncaughtException(err, true /* fromPromise */); [ Server!] ^ [ Server!] [ Server!] [UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<PgBoss>".] { [ Server!] code: 'ERR_UNHANDLED_REJECTION' [ Server!] } [ Server!] [ Server!] Node.js v18.20.3
kapa.ai
kapa.ai4mo ago
Let me check the knowledge base for you. One moment! :books:
MEE6
MEE64mo ago
Wohooo @ArDev, you just became a Waspeteer level 2!
kapa.ai
kapa.ai4mo ago
---------------------- The error message you're seeing suggests that the PostgreSQL database "OpenSaaS-ceab7ead0a" does not exist. This could be due to a few reasons: 1. The database was not created: Ensure that you have run the necessary commands to create the database. In the context of Wasp, this is usually done with the wasp db migrate-dev command. 2. The database name is incorrect: Double-check the database name in your Wasp project configuration. Make sure it matches the name of the database you've created. 3. Connection issues: There might be issues with how your application is trying to connect to the database. Ensure that the database is running and that the connection parameters (host, port, username, password) are correct. Unfortunately, without more information about your project setup or the specific steps you took before encountering this error, it's hard to provide a more specific solution. If none of the above suggestions help, please provide more details about your issue. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @ArDev, 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?
ArDev
ArDev4mo ago
what file has the wasp project configuration name? @kapa.ai
kapa.ai
kapa.ai4mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- The Wasp project configuration, including the project name, is defined in the main.wasp file. This file is your app's definition file and it defines the app's central components. Here is an example of what the main.wasp file might look like:
app TodoApp {
wasp: {
version: "^0.13.0" // Pins the version of Wasp to use.
},
title: "TodoApp" // Used as the browser tab title. Note that all strings in Wasp are double quoted!
}

route RootRoute { path: "/", to: MainPage }
page MainPage {
// We specify that the React implementation of the page is exported from
// `src/MainPage.jsx`. This statement uses standard JS import syntax.
// Use `@src` to reference files inside the `src` folder.
component: import { MainPage } from "@src/MainPage"
}
app TodoApp {
wasp: {
version: "^0.13.0" // Pins the version of Wasp to use.
},
title: "TodoApp" // Used as the browser tab title. Note that all strings in Wasp are double quoted!
}

route RootRoute { path: "/", to: MainPage }
page MainPage {
// We specify that the React implementation of the page is exported from
// `src/MainPage.jsx`. This statement uses standard JS import syntax.
// Use `@src` to reference files inside the `src` folder.
component: import { MainPage } from "@src/MainPage"
}
In this example, the project name is "TodoApp", as specified in the app declaration. Source: Docs > Tutorial > 2. Project Structure > main.wasp (https://wasp-lang.dev/docs/tutorial/project-structure#mainwasp) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @ArDev, 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?
ArDev
ArDev4mo ago
@kapa.ai so the title needs to be the same name as the database name?
kapa.ai
kapa.ai4mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- No, the title in the app declaration in the main.wasp file does not need to be the same as the database name. The title is used as the browser tab title and does not have any relation to the database name. The database configuration, including the database name, is typically defined in the db field inside the app declaration. Here is an example:
app MyApp {
title: "My app",
// ...
db: {
system: PostgreSQL,
seeds: [
import devSeed from "@src/dbSeeds.js"
],
prisma: {
clientPreviewFeatures: ["extendedWhereUnique"]
}
}
}
app MyApp {
title: "My app",
// ...
db: {
system: PostgreSQL,
seeds: [
import devSeed from "@src/dbSeeds.js"
],
prisma: {
clientPreviewFeatures: ["extendedWhereUnique"]
}
}
}
In this example, the database system is set to PostgreSQL. The actual database name is not explicitly set in the Wasp code, but is determined by the database system and the connection parameters. Source: Docs > Data-model > Databases > API Reference > The app.db Field Part 1 (https://wasp-lang.dev/docs/data-model/backends#the-appdb-field) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @ArDev, 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?
ArDev
ArDev4mo ago
The database name is incorrect: Double-check the database name in your Wasp project configuration. Make sure it matches the name of the database you've created. explain this in further detail @kapa.ai
kapa.ai
kapa.ai4mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- In Wasp, the database configuration is typically defined in the db field inside the app declaration in the main.wasp file. However, the database name itself is not explicitly set in the Wasp code. Instead, it's determined by the database system and the connection parameters. The connection to the database is usually defined by the DATABASE_URL environment variable. This variable is a connection string that includes the username, password, host, port, and database name. Here's an example of what it might look like:
postgresql://user:password@localhost:5432/mydatabase
postgresql://user:password@localhost:5432/mydatabase
In this example, mydatabase is the name of the database. If you're seeing an error that the database does not exist, it could mean that the database name in your DATABASE_URL does not match the name of an actual database in your PostgreSQL server. To resolve this issue, you should: 1. Check the DATABASE_URL in your project's .env.server file or in your system's environment variables. Make sure the database name in the connection string matches the name of the database you've created. 2. If you're using Docker to run your PostgreSQL server, make sure the database is correctly set up in your Docker configuration. 3. If you're not sure what the database name should be, you might need to check your PostgreSQL server to see what databases are available. You can do this by logging into your PostgreSQL server and running the \l command. Sources: - Docs > Data-model > Databases > Connecting to a Database (https://wasp-lang.dev/docs/data-model/backends#connecting-to-a-database) - Docs > Data-model > Databases > API Reference > The app.db Field Part 1 (https://wasp-lang.dev/docs/data-model/backends#the-appdb-field) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @ArDev, 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?
ArDev
ArDev4mo ago
[ Server!] error: database "OpenSaaS-ceab7ead0a" does not exist @kapa.ai
kapa.ai
kapa.ai4mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- The error message you're seeing suggests that the PostgreSQL database "OpenSaaS-ceab7ead0a" does not exist. This could be due to a few reasons: 1. The database was not created: Ensure that you have run the necessary commands to create the database. In the context of Wasp, this is usually done with the wasp db migrate-dev command. 2. The database name is incorrect: Double-check the database name in your Wasp project configuration. Make sure it matches the name of the database you've created. 3. Connection issues: There might be issues with how your application is trying to connect to the database. Ensure that the database is running and that the connection parameters (host, port, username, password) are correct. Unfortunately, without more information about your project setup or the specific steps you took before encountering this error, it's hard to provide a more specific solution. If none of the above suggestions help, please provide more details about your issue. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @ArDev, 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?
ArDev
ArDev4mo ago
@kapa.ai how can i completely create a fresh new project
kapa.ai
kapa.ai4mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- To create a fresh new Wasp project, you can follow these steps: 1. Run the wasp new command to start the interactive mode for setting up a new Wasp project. This will prompt you to input the project name and to select a template. The chosen template will then be used to generate the project directory with the specified name.
wasp new
wasp new
2. Enter the project name when prompted, for example MyFirstProject. 3. Choose a starter template. You can choose from several options like basic, todo-ts, saas, embeddings, and ai-generated. 4. After the project is created, navigate to the newly created directory:
cd MyFirstProject
cd MyFirstProject
5. Start the development server:
wasp start
wasp start
This will start the Wasp development server and also trigger the Wasp compiler, which generates the necessary wasp/* packages, including the type declarations. If you want to skip the interactive mode and create a new Wasp project with the default template, you can use wasp new <project-name>.
wasp new MyFirstProject
wasp new MyFirstProject
Sources: - Docs > General > CLI Reference > Commands > Creating a New Project (https://wasp-lang.dev/docs/general/cli#creating-a-new-project) - Docs > Tutorial > 1. Creating a New Project (https://wasp-lang.dev/docs/tutorial/create) - Docs > Project > Starter Templates (https://wasp-lang.dev/docs/project/starter-templates) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @ArDev, 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?
ArDev
ArDev4mo ago
@kapa.ai could be an issue with my ide?
kapa.ai
kapa.ai4mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- Yes, it's possible that your IDE could be causing issues, especially if it's not properly recognizing the Wasp files or the generated wasp/* packages. Here are a few things you can check: 1. IDE Support: Make sure your IDE has proper support for Wasp. Currently, Wasp doesn't have dedicated IDE plugins, but it's generally compatible with IDEs that support JavaScript and TypeScript. There are ongoing discussions and efforts to improve IDE support for Wasp files (source (https://github.com/wasp-lang/wasp/issues/900)). 2. File Paths: Check if your IDE is correctly resolving the file paths in your Wasp project. If your IDE is reporting errors about missing modules or type declarations, it might not be correctly resolving the paths to the wasp/* packages. 3. TypeScript Configuration: If you're using TypeScript, make sure your tsconfig.json file is correctly set up. There have been issues reported about discrepancies between the tsconfig.json files causing incorrect errors inside the IDE (source (https://github.com/wasp-lang/wasp/issues/1057)). 4. Syntax Highlighting: Wasp currently doesn't have syntax highlighting support for popular editors, which might affect the readability of your code (source (https://github.com/wasp-lang/wasp/issues/53)). If you're still having trouble, you might want to reach out to the Wasp community for help. You can do this through the Wasp Discord server (https://discord.com/channels/686873244791210014/1215750573278629958) or by opening an issue on the Wasp GitHub repository (https://github.com/wasp-lang/wasp). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @ArDev, 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?
ArDev
ArDev4mo ago
[ Wasp ] tsconfig.json(2,14): error TS6053: File '@tsconfig/node18/tsconfig.json' not found. [ Wasp ] ../../../../node_modules/@testing-library/jest-dom/types/jest.d.ts(1,23): error TS2688: Cannot find type definition file for 'jest'. [ Wasp ] ../../../../node_modules/@testing-library/jest-dom/types/jest.d.ts(9,27): error TS2304: Cannot find name 'expect'. [ Wasp ] ../../../../node_modules/vitest/node_modules/vite/dist/node/index.d.ts(5,41): error TS2307: Cannot find module 'rollup/parseAst' or its corresponding type declarations. [ Wasp ] There are types at '/mnt/d/AI Projects/AIWrapper/SaaS/app/node_modules/vitest/node_modules/rollup/dist/parseAst.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler' @kapa.ai
kapa.ai
kapa.ai4mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- The error messages you're seeing suggest that there are issues with your TypeScript configuration and/or your project's dependencies. Here are a few things you can try to resolve these issues: 1. Update TypeScript Configuration: The error message suggests that you should consider updating your moduleResolution setting to node16, nodenext, or bundler. You can do this by opening your tsconfig.json file and updating the moduleResolution field:
{
"compilerOptions": {
"moduleResolution": "node16"
}
}
{
"compilerOptions": {
"moduleResolution": "node16"
}
}
2. Install Missing Type Definitions: The error messages also suggest that some type definitions are missing. You can try installing these type definitions with npm:
npm install --save-dev @types/jest
npm install --save-dev @types/jest
3. Check Dependency Versions: Make sure that the versions of your dependencies are compatible with each other. In particular, check the versions of @testing-library/jest-dom, jest, and vite. You might need to update these dependencies to versions that include the necessary type definitions. 4. Reinstall Node Modules: Sometimes, these kinds of issues can be resolved by deleting your node_modules directory and reinstalling your dependencies. You can do this with the following commands:
rm -rf node_modules
npm install
rm -rf node_modules
npm install
If none of these suggestions help, you might want to reach out to the Wasp community for help. You can do this through the Wasp Discord server (https://discord.com/channels/686873244791210014/1215750573278629958) or by opening an issue on the Wasp GitHub repository (https://github.com/wasp-lang/wasp). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @ArDev, 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?
ArDev
ArDev4mo ago
This site can’t be reachedlocalhost refused to connect. Try: Checking the connection Checking the proxy and the firewall ERR_CONNECTION_REFUSED[ Server ] > [email protected] validate-env [ Server ] > node -r dotenv/config ./scripts/validate-env.mjs [ Server ] [ Server ] 🔍 Validating environment variables... [ Server ] 🚀 "Email and password" auth initialized [ Server ] Starting pg-boss... [ Server ] pg-boss started! [ Server ] Server listening on port 3001 @kapa.ai
kapa.ai
kapa.ai4mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- The error message "This site can’t be reached localhost refused to connect" typically indicates that your web server isn't properly set up to accept connections on the specified port. In this case, it seems like your server is running on port 3001. Here are a few things you can check: 1. Correct Port: Make sure you're trying to connect to the correct port. If your server is running on port 3001, you should be connecting to <http://localhost:3001.> 2. Server Running: Ensure that your server is running. From the logs you provided, it seems like your server is starting up correctly and listening on port 3001. 3. Firewall Settings: Check your firewall settings. Sometimes, your firewall might block connections to certain ports. You might need to configure your firewall to allow connections to port 3001. 4. Proxy Settings: If you're using a proxy, make sure it's correctly configured to allow connections to your server. 5. Restart Server: If none of the above work, try restarting your server. Sometimes, a simple restart can resolve connection issues. If you're still having trouble, you might want to reach out to the Wasp community for help. You can do this through the Wasp Discord server (https://discord.com/channels/686873244791210014/1215750573278629958) or by opening an issue on the Wasp GitHub repository (https://github.com/wasp-lang/wasp). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @ArDev, 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?
ArDev
ArDev4mo ago
@kapa.ai front end seems to not be loading? the sever works fine
kapa.ai
kapa.ai4mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- If your server is running fine but the frontend isn't loading, there could be several reasons for this. Here are a few things you can check: 1. Frontend Server: In a Wasp project, the frontend and backend are served on different ports. The backend is typically on port 3001, while the frontend is on port 3000. Make sure you're connecting to <http://localhost:3000> for the frontend. 2. Error Messages: Check the console in your browser's developer tools for any error messages. These could provide clues about what's going wrong. 3. Wasp Start Command: Make sure you're running the wasp start command in your project's root directory. This command starts both the frontend and backend servers. 4. Project Configuration: Check your project's configuration in the main.wasp file. Make sure the app declaration is correctly set up, especially the frontendUrl field if it's present. 5. Rebuild Project: Try stopping the Wasp server (you can do this with Ctrl+C in the terminal), running wasp clean to clean the build artifacts, and then running wasp start again to start the server and rebuild the project. If none of these suggestions help, you might want to reach out to the Wasp community for help. You can do this through the Wasp Discord server (https://discord.com/channels/686873244791210014/1215750573278629958) or by opening an issue on the Wasp GitHub repository (https://github.com/wasp-lang/wasp). Sources: - Docs > Project > Server Config (https://wasp-lang.dev/docs/project/server-config) - Docs > Advanced > Accessing the configuration (https://wasp-lang.dev/docs/advanced/accessing-app-config) - Github Issue (closed): wasp start takes a lot of memory (~1 GB) to run frontend (https://github.com/wasp-lang/wasp/issues/955) - Discord support thread: nothing shows up in localhost:3000 after wasp start (https://discord.com/channels/686873244791210014/1213958217537814640) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @ArDev, 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?
ArDev
ArDev4mo ago
@kapa.ai it seems to work on the network port but not on the local port?
kapa.ai
kapa.ai4mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- If your application is accessible over the network but not locally, it could be due to several reasons: 1. Firewall or Security Software: Your local firewall or security software might be blocking access to the application on your local machine. You might need to configure your firewall or security software to allow access to the application. 2. Network Configuration: Your network configuration might be set up in a way that allows access to the application over the network but not locally. You might need to adjust your network configuration to allow local access. 3. Application Configuration: The application itself might be configured to only accept connections from certain IP addresses or networks. You might need to adjust the application's configuration to allow local access. 4. Port Forwarding: If you're using port forwarding (for example, with a tool like ngrok), make sure you're forwarding both the frontend and backend ports. In a Wasp project, the frontend typically runs on port 3000 and the backend on port 3001. If you're only forwarding one of these ports, you might be able to access part of the application over the network but not locally (source (https://discord.com/channels/686873244791210014/1218081390176763914)). If none of these suggestions help, you might want to reach out to the Wasp community for help. You can do this through the Wasp Discord server (https://discord.com/channels/686873244791210014/1215750573278629958) or by opening an issue on the Wasp GitHub repository (https://github.com/wasp-lang/wasp). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @ArDev, 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?
ArDev
ArDev4mo ago
is it okay to use it on the network port and safe?
MEE6
MEE64mo ago
Wohooo @ArDev, you just became a Waspeteer level 3!
ArDev
ArDev4mo ago
@kapa.ai
kapa.ai
kapa.ai4mo ago
Let me check the knowledge base for you. One moment! :books: Sorry @ArDev, 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?
ArDev
ArDev4mo ago
@kapa.ai is it okay to use it on the network port is it safe?
kapa.ai
kapa.ai4mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- Yes, it's generally safe to use your application over the network port, as long as you follow standard security practices. Here are a few things to keep in mind: 1. Access Control: Make sure that only authorized users can access your application. This might involve setting up a firewall, using a VPN, or implementing authentication in your application. 2. Data Encryption: If you're sending sensitive data over the network, make sure it's encrypted. This is typically done using HTTPS or a similar secure protocol. 3. Network Security: Make sure your network is secure. This might involve using a secure Wi-Fi network, setting up a firewall, or regularly updating your network equipment to patch any security vulnerabilities. 4. Application Security: Follow best practices for securing your application. This might involve regularly updating your dependencies, sanitizing user input to prevent injection attacks, and following the principle of least privilege when setting up user roles and permissions. Remember, while Wasp provides some security features out of the box (like hashed and salted passwords), it's ultimately your responsibility to ensure the security of your application and your users' data. Sources: - Docs > Auth > Username and Password (https://wasp-lang.dev/docs/auth/username-and-pass) - Github Issue (closed): Realworld app returning Network Error > Comments Part 5 (https://github.com/wasp-lang/wasp/issues/460) - Github Issue (closed): Replit Template: External Port Issue & Workaround > Original post (https://github.com/wasp-lang/wasp/issues/957) - Discord support thread: "wasp start db" takes too much time. > Answers Part 3 (https://discord.com/channels/686873244791210014/1223569423177089093) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @ArDev, 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?
Want results from more Discord servers?
Add your server