Strapi restart after creating the first DB entry

Dear all,

I have Strapi running in Docker with Postgres and Nginx in the same docker compose file. After entering the first entry in the DB Strapi started constantly restarting.

This is the error:

ERROR in ./src/api/whisky/routes/whisky.ts:7:43
TS2345: Argument of type ‘“api::whisky.whisky”’ is not assignable to parameter of type ‘ContentType’.
5 | import { factories } from ‘@strapi/strapi’;
6 |

7 | export default factories.createCoreRouter(‘api::whisky.whisky’);
| ^^^^^^^^^^^^^^^^^^^^
8 |

And this is the file it does not like ):

/**

  • whisky router
    */

import { factories } from ‘@strapi/strapi’;

export default factories.createCoreRouter(‘api::whisky.whisky’);

Can you please advise the way of eliminating the issue?

This topic has been created from a Discord post (1232222903697805312) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord

Do you actually have the content-type for whisky?

Derrick, thanks for the reply.

Yes, I created it in the GUI. Not sure where to check it in the code.

would be in the ./src/content-types/whiskey/content-types/...

you should have the schema.json in there

Yes, it is there

hmmm that’s odd, is your code public somewhere I can look at it?

GitHub/GitLab?

I erased the containers and the images (docker rm and docker rmi) and built em again. Now it is working fine. The DB remained the same.

But here is the code just in case.

Odd guessing something was just borked in the container, code looks fine but I don’t use docker.

Derrick, many thanks for your kind support. Much appreciated!

Have a great evening!

You too! :grin: