K-Phoen / backstage-plugin-announcements

Announcements plugin for Backstage
MIT License
52 stars 29 forks source link

[Error] After update Backstage v1.20.3 #189

Closed padupe closed 8 months ago

padupe commented 9 months ago

After updating the Backstage version, we are receiving the following error after running yarn tsc:

packages/backend/src/plugins/announcements.ts:12:5 - error TS2322: Type 'DatabaseService' is not assignable to type 'PluginDatabaseManager'.
  The types returned by 'getClient()' are incompatible between these types.
    Type 'Promise<import("/home/padupe/acme/backstage/node_modules/knex/types/index").Knex<any, any[]>>' is not assignable to type 'Promise<import("/home/padupe/acme/backstage/node_modules/@k-phoen/backstage-plugin-announcements-backend/node_modules/knex/types/index").Knex<any, any[]>>'.
      Type 'import("/home/padupe/acme/backstage/node_modules/knex/types/index").Knex<any, any[]>' is not assignable to type 'import("/home/padupe/acme/backstage/node_modules/@k-phoen/backstage-plugin-announcements-backend/node_modules/knex/types/index").Knex<any, any[]>'.
        The types of 'raw(...).transacting' are incompatible between these types.
          Type '(trx: import("/home/padupe/acme/backstage/node_modules/knex/types/index").Knex.Transaction<any, any[]>) => import("/home/padupe/acme/backstage/node_modules/knex/types/index").Knex.Raw<any>' is not assignable to type '(trx: import("/home/padupe/acme/backstage/node_modules/@k-phoen/backstage-plugin-announcements-backend/node_modules/knex/types/index").Knex.Transaction<any, any[]>) => import("/home/padupe/acme/backstage/node_modules/@k-phoen/backstage-plugin-announcements-backend/node_modules/knex/types/index").Knex.R...'.
            Types of parameters 'trx' and 'trx' are incompatible.
              Type 'Transaction<any, any[]>' is missing the following properties from type 'Transaction<any, any[]>': comment, except, havingNull, havingNotNull, updateFrom

12     database,
       ~~~~~~~~

  node_modules/@k-phoen/backstage-plugin-announcements-backend/dist/index.d.ts:75:5
    75     database: PluginDatabaseManager;
           ~~~~~~~~
    The expected type comes from property 'database' which is declared here on type 'AnnouncementsContextOptions'

Found 1 error in packages/backend/src/plugins/announcements.ts:12

error Command failed with exit code 2.

More Info

O.S: Ubuntu 22.04 Backstage Version: 1.20.3 Node Version: 18.16.1

To reproduce

  1. Update Backstage Version

    yarn backstage-cli versions:bump
  2. Update Announcements Version

    yarn backstage-cli versions:bump --pattern '@k-phoen/backstage-plugin-announcements-backend'

PSC @claudinei-ferreira

xyxy1111 commented 9 months ago

Have same issue, but backstage version is 1.18.3.

thabrez538 commented 9 months ago

Even I have the same issue,backstage version is 1.20.3

sharadpattanshetti commented 9 months ago

We are also facing the same issue when bumped to 1.20.3. Is there any plan to provide a patch?

@K-Phoen