community-plugins: ๐Ÿ› sonarqube (+ others): tsc:full fails for wrong import

Workspace

sonarqube

๐Ÿ“œ Description

tsc:full fails after backstage 1.39.0 update. The same import is also in other community plugins:

  • linguist
  • grafana
  • sentry
  • adr
  • jenkins
  • github-deployments
  • linkerd
  • github-actions
  • github-issues
  • cicd-statistics
  • azure-devops
  • github-pull-requests-board

See https://github.com/search?q=repo%3Abackstage%2Fcommunity-plugins %40backstage%2Fcatalog-model%2Findex&type=code

๐Ÿ‘ Expected behavior

tsc should pass

๐Ÿ‘Ž Actual Behavior with Screenshots

node_modules/@backstage-community/plugin-sonarqube/dist/index.d.ts:4:49 - error TS2307: Cannot find module โ€˜@backstage/catalog-model/indexโ€™ or its corresponding type declarations.

4 import * as _backstage_catalog_model_index from โ€˜@backstage/catalog-model/indexโ€™; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Found 1 error in node_modules/@backstage-community/plugin-sonarqube/dist/index.d.ts:4

๐Ÿ‘Ÿ Reproduction steps

  1. add sonarqube plugin to backstage 1.39.0
  2. run tsc --skipLibCheck false --incremental false

๐Ÿ“ƒ Provide the context for the Bug.

No response

๐Ÿ‘€ Have you spent some time to check if this bug has been raised before?

  • I checked and didnโ€™t find similar issue

๐Ÿข Have you read the Code of Conduct?

Are you willing to submit PR?

None

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 19 (19 by maintainers)

Most upvoted comments

I did trigger this for the sonarqube plugin as I think itโ€™s the only one that would have early impact to the Community. If my thinking holds the CI should fail as the API Report needs to be updated: https://github.com/backstage/community-plugins/pull/4043

Note: I wonโ€™t be versioning bumping the maintainer owned plugins until next week, roughly May 30th, as Iโ€™m taking a long-weekend to tend to my yard and garden. Feel free to move forward with that if you need one or more updated ๐Ÿ‘

Yup, I was busy testing with a new create-app instance, the Demo site is not a good test case. On a fresh create-app instance I get this error as well. Also for the plugins with the Alpha export you wonโ€™t hit this error. I installed Linguist on this instance and it was fine. I think if I tried to use the New Frontend System then I would hit it.

So I think the solution is that these need to be version bumped to 1.39.0 as itโ€™s not a direct code fix. We donโ€™t directly import in the code for any of these plugins from the /index path.

I think I missed that when I closed this, with their being no results in the search I just sort of assumed all was good.

Hi @pjungermann, as the Community Plugin Maintainers donโ€™t own this plugin and it wasnโ€™t in the initial set of plugins listed in this issue or in the provided search results I didnโ€™t give it a look. The code is correct in the repo so the only conclusion I can make is that those changes have not been published yet. This PR needs to be approved and merged by the owners listed: https://github.com/backstage/community-plugins/pull/4039. Feel free to ping them to move this along ๐Ÿ‘

Closing as all impacted plugins have been updated and release, this list returns no results: https://github.com/search?q=repo%3Abackstage%2Fcommunity-plugins %40backstage%2Fcatalog-model%2Findex&type=code ๐Ÿš€

Great to see a fix upcoming.

I got the same error for another plugin.

node_modules/@backstage-community/plugin-tech-insights/dist/index.d.ts:4:49 - error TS2307: Cannot find module '@backstage/catalog-model/index' or its corresponding type declarations.

4 import * as _backstage_catalog_model_index from '@backstage/catalog-model/index';
                                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I saw it for

  • @backstage-community/plugin-github-actions
  • @backstage-community/plugin-sentry

but was fixed after upgrading to the latest versions for these. Not for the other two, though.

Looking at the API reports or the index.d.ts when installed, was also interesting to see the difference between

@backstage-community/plugin-sonarqube

import * as _backstage_catalog_model_index from '@backstage/catalog-model/index';

and @backstage-community/plugin-sonarqube-react

import { Entity } from '@backstage/catalog-model';

@awanlin yes itโ€™s tsc:full, changed it. At least for our instance the version bump itself did not clean this, had to manually change the import.

If anyone wants to pick any of these up I believe simply removing the /index will solve this problem i.e.

import { Entity } from '@backstage/catalog-model/index'; --> import { Entity } from '@backstage/catalog-model';

Edit: Maybe not ๐Ÿค” ๐Ÿ’ญ