Current solution is use an eslint plugin eslint-plugin-unused-imports and running a eslint --fix ./src/types --ext .js,.jsx,.ts,.tsx command after my typegen command in my src/extensions/content-type-builder/strapi-server.ts file. This will remove the unused import and prevent the Strapi app from exiting.
When running the following script
It outputs the following file in
src/types/builtins/Media.ts
It imports
ExtractNested
, but is never used.Which causes the Strapi app to exit, and because I Generate interfaces as soon as you create/modify/delete new components or content types the Strapi application exists everytime I create, updated or delete a collection.
Current solution is use an eslint plugin eslint-plugin-unused-imports and running a
eslint --fix ./src/types --ext .js,.jsx,.ts,.tsx
command after mytypegen
command in mysrc/extensions/content-type-builder/strapi-server.ts
file. This will remove the unused import and prevent the Strapi app from exiting.