strapi-plugin-record-locking icon indicating copy to clipboard operation
strapi-plugin-record-locking copied to clipboard

Having plugin installed breaks `npm run strapi report`

Open broksonic21 opened this issue 1 year ago • 1 comments

Example results here:

> strapi report

Launched In: 859 ms
Environment: development
OS: darwin-arm64
Strapi Version: 4.22.0
Node/Yarn Version: npm/10.5.1 node/v20.12.1 darwin arm64 workspaces/false
Edition: Community
Database: mysql2
TypeError: Cannot read properties of undefined (reading 'query')
    at module.exports [as destroy] (/Users/REDACTED/REDACTED/REDACTED/node_modules/@notum-cz/strapi-plugin-record-locking/server/destroy.js:7:13)
    at Object.destroy (/Users/REDACTED/REDACTED/REDACTED/node_modules/@strapi/strapi/dist/core/domain/module/index.js:53:45)
    at Object.destroy (/Users/REDACTED/REDACTED/REDACTED/node_modules/@strapi/strapi/dist/core/registries/modules.js:33:19)
    at async Strapi.runLifecyclesFunctions (/Users/REDACTED/REDACTED/REDACTED/node_modules/@strapi/strapi/dist/Strapi.js:440:5)
    at async Strapi.destroy (/Users/REDACTED/REDACTED/REDACTED/node_modules/@strapi/strapi/dist/Strapi.js:226:5)
    at async action (/Users/REDACTED/REDACTED/REDACTED/node_modules/@strapi/strapi/dist/commands/actions/report/action.js:26:3)

broksonic21 avatar Apr 04 '24 12:04 broksonic21

@omikulcik @martincapek i see you listed as maintainer and main star. Any way to get this in on a release?

broksonic21 avatar May 07 '24 12:05 broksonic21

Thank you for reporting this. I have fixed this by adding optional chaining in https://github.com/notum-cz/strapi-plugin-record-locking/commit/afd8b915d10b7da9b93290c59bf4cfd9c1d71b04 and will release new version.

omikulcik avatar Jun 12 '24 09:06 omikulcik

Thanks @omikulcik - confirmed this works on the new release!

broksonic21 avatar Jun 12 '24 13:06 broksonic21