Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yarn tsc error when bumping backstage to 1.32.1 #76

Closed
nia-potato opened this issue Oct 17, 2024 · 5 comments · Fixed by #78
Closed

yarn tsc error when bumping backstage to 1.32.1 #76

nia-potato opened this issue Oct 17, 2024 · 5 comments · Fixed by #78

Comments

@nia-potato
Copy link

Hi @dweber019 thanks for the great plugin!

btw I am getting this error when running yarn tsc

packages/app/src/App.tsx:147:3 - error TS2322: Type '(Partial<import("/var/gitlabrunner/buildbot/workspace/builds/z3Qtt7Xp/0/corp/backstage/src/node_modules/@dweber019/backstage-plugin-simple-icons/node_modules/@backstage/core-app-api/dist/index").AppIcons> & { ...; }) | undefined' is not assignable to type '(Partial<import("/var/gitlabrunner/buildbot/workspace/builds/z3Qtt7Xp/0/corp/backstage/src/node_modules/@backstage/core-app-api/dist/index").AppIcons> & { ...; }) | undefined'.
  Type 'Partial<AppIcons> & { [x: string]: IconComponent; }' is not assignable to type '(Partial<AppIcons> & { [x: string]: IconComponent; }) | undefined'.
147   icons: simpleIconsColor,

is this expected?

@dweber019
Copy link
Owner

dweber019 commented Oct 19, 2024

I don't think so, at least I don't get the error in this repo.
Do you have more information like TS version and so on.

@mattthym
Copy link

I upgraded our Backstage instance yesterday as well and can confirm that something went awry with the plugin.

I simply ran the upgrade command and changed nothing else:

yarn backstage-cli versions:bump
yarn run v1.22.22
$ tsc
packages/app/src/App.tsx:87:3 - error TS2322: Type '(Partial<import("/home/mathym/Development/work/developer-portal/node_modules/@dweber019/backstage-plugin-simple-icons/node_modules/@backstage/core-app-api/dist/index").AppIcons> & { ...; }) | undefined' is not assignable to type '(Partial<import("/home/mathym/Development/work/developer-portal/node_modules/@backstage/core-app-api/dist/index").AppIcons> & { [x: string]: import("/home/mathym/Development/work/developer-portal/node_modules/@backstage/core-plugin-api/dist/index").IconComponent; }) | undefined'.
  Type 'Partial<AppIcons> & { [x: string]: IconComponent; }' is not assignable to type '(Partial<AppIcons> & { [x: string]: IconComponent; }) | undefined'.

87   icons: simpleIcons,
     ~~~~~


Found 1 error in packages/app/src/App.tsx:87
λ cat backstage.json
{
  "version": "1.32.2"
}

Using the default tsconfig.json and package.json of Backstage:

{
  "extends": "@backstage/cli/config/tsconfig.json",
  "include": [
    "packages/*/src",
    "plugins/*/src",
    "plugins/*/dev",
    "plugins/*/migrations"
  ],
  "exclude": ["node_modules"],
  "compilerOptions": {
    "outDir": "dist-types",
    "rootDir": "."
  }
}
{
  "name": "root",
  "version": "1.0.0",
  "private": true,
  "engines": {
    "node": "18 || 20"
  },
  "scripts": {
    "dev": "concurrently \"yarn start\" \"yarn start-backend\"",
    "start": "yarn workspace app start",
    "start-backend": "yarn workspace backend start",
    "build:backend": "yarn workspace backend build",
    "build:all": "backstage-cli repo build --all",
    "build-image": "yarn workspace backend build-image",
    "tsc": "tsc",
    "tsc:full": "tsc --skipLibCheck false --incremental false",
    "clean": "backstage-cli repo clean",
    "test": "backstage-cli repo test",
    "test:all": "backstage-cli repo test --coverage",
    "test:e2e": "playwright test",
    "fix": "backstage-cli repo fix",
    "lint": "backstage-cli repo lint --since origin/main",
    "lint:all": "backstage-cli repo lint",
    "prettier:check": "prettier --check .",
    "new": "backstage-cli new --scope internal"
  },
  "workspaces": {
    "packages": [
      "packages/*",
      "plugins/*"
    ]
  },
  "devDependencies": {
    "@backstage/cli": "^0.28.0",
    "@backstage/e2e-test-utils": "^0.1.1",
    "@playwright/test": "^1.32.3",
    "@spotify/prettier-config": "^12.0.0",
    "concurrently": "^8.0.0",
    "lerna": "^7.3.0",
    "node-gyp": "^10.0.0",
    "prettier": "^2.3.2",
    "typescript": "~5.4.0"
  },
  "resolutions": {
    "@types/react": "^18",
    "@types/react-dom": "^18"
  },
  "prettier": "@spotify/prettier-config",
  "lint-staged": {
    "*.{js,jsx,ts,tsx,mjs,cjs}": [
      "eslint --fix",
      "prettier --write"
    ],
    "*.{json,md}": [
      "prettier --write"
    ]
  }
}

@dweber019
Copy link
Owner

Having a hard time to reproduce this but changed to a simpler type definition in #78

@dweber019
Copy link
Owner

@mattthym are you sure your on the latest update with all changes from the upstream backstage project as I can see differences in the yarn scripts like https://github.com/backstage/backstage/blob/master/packages/create-app/templates/default-app/package.json.hbs#L9

@mattthym
Copy link

Thanks for fixing, @dweber019! 💐

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants