strapi-community / strapi-plugin-protected-populate

MIT License
20 stars 5 forks source link

Unable to uninstall the plugin #17

Closed monolithed closed 10 months ago

monolithed commented 10 months ago
➜ npm run strapi uninstall strapi-plugin-protected-populate

> strapi@0.1.0 strapi
> strapi uninstall strapi-plugin-protected-populate

? Do you want to delete the plugin generated files in the extensions folder ? Yes
Cannot find module '@strapi/plugin-strapi-plugin-protected-populate/package.json'
Require stack:
- /Users/monolithed/workspace/pergum/strapi/node_modules/@strapi/strapi/dist/load/package-path.js
- /Users/monolithed/workspace/pergum/strapi/node_modules/@strapi/strapi/dist/commands/actions/install/action.js
- /Users/monolithed/workspace/pergum/strapi/node_modules/@strapi/strapi/dist/commands/actions/install/command.js
- /Users/monolithed/workspace/pergum/strapi/node_modules/@strapi/strapi/dist/commands/index.js
- /Users/monolithed/workspace/pergum/strapi/node_modules/@strapi/strapi/dist/cli.js
- /Users/monolithed/workspace/pergum/strapi/node_modules/@strapi/strapi/bin/strapi.js
Boegie19 commented 10 months ago

@monolithed Sorry for the late response. The uninstall command is deprecated and only works on strapi core team maintained plugins. aka any package that starts with @strapi/

to uninstall remove the plugin from your package.json and remove and the protected populate folder. To keep the data but not use the plugin anymore you can keep the protected populate folder so it will use it next time. you re-install the plugin.

Also can I ask just out of curiosity what is the reason you are removing the plugin?

monolithed commented 10 months ago

@Boegie19,

In fact, there are several files that need to be modified:

And I believe there are still dependencies in the database that need to be addressed.

Also can I ask just out of curiosity what is the reason you are removing the plugin?

Initially, I intended to use Strapi for production, but after working with this system for 2 days, I encountered a dozen bugs and experienced numerous random crashes. Therefore, I decided to use Strapi only in the development environment and manually transfer the data from it to MongoDB.

The second reason why I decided to remove this plugin: in some cases, it would randomly return an empty result and add a 'localizations' field to the response, causing my parser to crash.

Boegie19 commented 10 months ago

In fact, there are several files that need to be modified:

  • .strapi/client/app.js
  • package.json
  • types/generated/contentTypes.d.ts
  • And I believe there are still dependencies in the database that need to be addressed.

To remove the plugin you need to do the following staps.

  1. change package.json to remove plugin
  2. run yarn install or npm install
  3. run strapi build (This removes any admin ui changes the plugin did)
  4. run yarn develop/npm run develop or yarn start or npm run start (This would remove any tables that the plugin created (only thing it does not clean is the core-store) stap 3 and 4 change .strapi/client/app.js and types/generated/contentTypes.d.ts since they are auto generated by strapi.

The second reason why I decided to remove this plugin: in some cases, it would randomly return an empty result and https://github.com/strapi/strapi/issues/18577 to the response, causing my parser to crash.

sounds to me like issues with the documentation plugin or could also be a miss configuration.

If you did not select everyting that needs to be populatable in my plugin UI it will not allow you to populate it since it is a secondary security layer ontop of strapi.

monolithed commented 10 months ago

@Boegie19

This only helped to remove data from .strapi/client/app.js. contentTypes.d.ts, and the data in the database remained unchanged. API requests still return the 'localizations' field. This may not be related to your plugin, as I have previously encountered 'stuck' data. Anyway thanks for helping me!