strapi / foodadvisor

🥘 THE Strapi demo application
MIT License
1.09k stars 446 forks source link

TypeError: container is not a function #90

Closed staminna closed 2 years ago

staminna commented 3 years ago

Hi

I am using macOS Catalina and Strapi food advisor version 3.0.0. I was renaming the restaurant type to event type and when Strapi asked to restart the server, it never got back:

error TypeError: container is not a function
    at /Users/jorgenunes/webdev/strapi/adac/foodadvisor/api/node_modules/knex/lib/transaction.js:48:20
From previous event:
    at /Users/jorgenunes/webdev/strapi/adac/foodadvisor/api/node_modules/knex/lib/transaction.js:41:10
    at processImmediate (internal/timers.js:456:21)
From previous event:
    at new Transaction (/Users/jorgenunes/webdev/strapi/adac/foodadvisor/api/node_modules/knex/lib/transaction.js:36:39)
    at Client_SQLite3.transaction (/Users/jorgenunes/webdev/strapi/adac/foodadvisor/api/node_modules/knex/lib/client.js:141:12)
    at Function.transaction (/Users/jorgenunes/webdev/strapi/adac/foodadvisor/api/node_modules/knex/lib/util/make-knex.js:56:31)
    at migrateForBookshelf (/Users/jorgenunes/webdev/strapi/adac/foodadvisor/api/node_modules/strapi-plugin-i18n/config/functions/migrations/content-type/disable/migrate-for-bookshelf.js:12:30)
    at Object.before (/Users/jorgenunes/webdev/strapi/adac/foodadvisor/api/node_modules/strapi-plugin-i18n/config/functions/migrations/content-type/disable/index.js:22:11)
    at async MigrationManager.runBefore (/Users/jorgenunes/webdev/strapi/adac/foodadvisor/api/node_modules/strapi-database/lib/migration-manager.js:46:9)
    at async MigrationManager.run (/Users/jorgenunes/webdev/strapi/adac/foodadvisor/api/node_modules/strapi-database/lib/migration-manager.js:19:5)
    at async module.exports (/Users/jorgenunes/webdev/strapi/adac/foodadvisor/api/node_modules/strapi-connector-bookshelf/lib/build-database-schema.js:407:3)
    at async /Users/jorgenunes/webdev/strapi/adac/foodadvisor/api/node_modules/strapi-connector-bookshelf/lib/mount-models.js:671:11
    at async mountConnection (/Users/jorgenunes/webdev/strapi/adac/foodadvisor/api/node_modules/strapi-connector-bookshelf/lib/index.js:95:7)
    at async Promise.all (index 0)
    at async Object.initialize (/Users/jorgenunes/webdev/strapi/adac/foodadvisor/api/node_modules/strapi-database/lib/connector-registry.js:30:9)
    at async DatabaseManager.initialize (/Users/jorgenunes/webdev/strapi/adac/foodadvisor/api/node_modules/strapi-database/lib/database-manager.js:43:5)
    at async Strapi.load (/Users/jorgenunes/webdev/strapi/adac/foodadvisor/api/node_modules/strapi/lib/Strapi.js:354:5)
    at async Strapi.start (/Users/jorgenunes/webdev/strapi/adac/foodadvisor/api/node_modules/strapi/lib/Strapi.js:196:9)
error Command failed with exit code 1.
Mcastres commented 3 years ago

Hello @staminna 👋 I don't recommend modifying the name of existing content-types since this demo must use them as it is.

I just renamed the collection-type just like you did and it went well. Can you send me the steps to reproduce this issue?

staminna commented 3 years ago

I don't remeber exactly, but apparently there is no way to recover from this, except hacking the database. Am I correct?

Maxime Castres @.***> escreveu no dia terça, 12/10/2021 à(s) 11:43:

Hello @staminna https://github.com/staminna 👋 I don't recommend modifying the name of existing content-types since this demo must use them as it is.

I just renamed the collection-type just like you did and it went well. Can you send me the steps to reproduce this issue?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/strapi/foodadvisor/issues/90#issuecomment-940889140, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAD5Y3BUKCUVX5KYUAPCLRLUGQGNFANCNFSM5FRWWFLQ .

Mcastres commented 3 years ago

Not really sure to be honest but yes, this would require some manual operations on the database or file system 🤔