-
Notifications
You must be signed in to change notification settings - Fork 2
Troubleshooting
If you're having trouble running the project, or seeing a particular error, you may use this guide to find common problems & fixes.
This is a TypeScript compiler error. It means the compiler thinks you are using an invalid type. Either:
- The compiler is correct, you should fix your code.
- The compiler is wrong. This doesn't happen often, but sometimes the type inferencing is not perfect and you need to explicitly tell the compiler that something is valid.
If you are in case 2, you may add a type cast as any
to stop the compiler from making type assertions. For example:
const stringOrNumber: string | number = 'hello'
const str: string = stringOrNumber // compiler error: "string | number" is not assignable to "string"
const str2: string = stringOrNumber as any // compiles
When running server.ts
, we try to establish a connection to a MySQL database running on localhost port 3307. This error means that the SQL connection could not be established.
Are you running MySQL? Before developing your project run:
docker-compose up -d
This will start a MySQL (and Redis) server on localhost. Check to make sure you have both containers running:
docker ps
When defining ORM entities (classes that help you create database tables/rows), you must register these entities after defining the entity/class. Look for the entities
array in the initORM()
function in sql.ts
.
export async function initORM() {
return await createConnection({
....
entities: [ ... list your entities here ...],
...
})
}