procore-oss / backstage-plugin-announcements

Announcements Plugin for Backstage
https://procore-oss.github.io/backstage-plugin-announcements/
MIT License
30 stars 23 forks source link

πŸ› Bug Report: theme.spacing is not function on announcements/create page #492

Open NRisticHtec opened 1 week ago

NRisticHtec commented 1 week ago

πŸ“œ Description

When im trying to open announcements/create page i get error that "theme.spacing is not a function". Error-screenshot

I tried add theme provider at App.tsx but not helped:

...
export const myTheme = createUnifiedTheme({
  ...createBaseThemeOptions({
    palette: palettes.light,
  }),
  fontFamily: 'Comic Sans MS',
  defaultPageTheme: 'home',
  spacing: 8,
});
...
const app = createApp({
  themes: [
    {
      id: 'my-theme',
      title: 'My Custom Theme',
      variant: 'light',
      Provider: ({ children }) => (
        <UnifiedThemeProvider theme={myTheme} children={children} />
      ),
    }
  ],

Here are dependencies from packages/app/package.json:

"dependencies": {
    "@backstage-community/plugin-cost-insights": "^0.12.29",
    "@backstage-community/plugin-tech-radar": "^1.0.0",
    "@backstage-community/plugin-todo": "^0.2.42",
    "@backstage/app-defaults": "^1.5.8",
    "@backstage/catalog-model": "^1.5.0",
    "@backstage/cli": "^0.26.11",
    "@backstage/core-app-api": "^1.14.0",
    "@backstage/core-components": "^0.14.9",
    "@backstage/core-plugin-api": "^1.9.3",
    "@backstage/integration-react": "^1.1.29",
    "@backstage/plugin-api-docs": "^0.11.7",
    "@backstage/plugin-catalog": "^1.21.1",
    "@backstage/plugin-catalog-common": "^1.0.25",
    "@backstage/plugin-catalog-graph": "^0.4.7",
    "@backstage/plugin-catalog-import": "^0.12.1",
    "@backstage/plugin-catalog-react": "^1.13.1",
    "@backstage/plugin-home": "^0.7.11",
    "@backstage/plugin-org": "^0.6.27",
    "@backstage/plugin-permission-react": "^0.4.24",
    "@backstage/plugin-scaffolder": "^1.23.0",
    "@backstage/plugin-search": "^1.4.14",
    "@backstage/plugin-search-react": "^1.7.13",
    "@backstage/plugin-techdocs": "^1.10.8",
    "@backstage/plugin-techdocs-module-addons-contrib": "^1.1.12",
    "@backstage/plugin-techdocs-react": "^1.2.6",
    "@backstage/plugin-user-settings": "^0.8.9",
    "@backstage/theme": "^0.5.6",
    "@material-ui/core": "^4.12.2",
    "@material-ui/icons": "^4.9.1",
    "@mui/material": "^6.1.6",
    "@oriflame/backstage-plugin-score-card": "^0.9.1",
    "@procore-oss/backstage-plugin-announcements": "^0.11.2",
    "history": "^5.0.0",
    "react": "^18.0.2",
    "react-dom": "^18.0.2",
    "react-router": "^6.3.0",
    "react-router-dom": "^6.3.0",
    "react-use": "^17.2.4"
  }

Any idea how to fix this?

πŸ‘ Expected behavior

There should not be any error.

πŸ‘Ž Actual Behavior with Screenshots

There is error.

πŸ‘Ÿ Reproduction steps

Install plugin as described in installation guide and open announcements/create(localhost:3000/announcements/create) page.

πŸ“ƒ Provide the context for the Bug.

No response

πŸ–₯️ Your Environment

No response

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

Are you willing to submit PR?

None

kurtaking commented 1 day ago

https://github.com/procore-oss/backstage-plugin-announcements/issues/472 is around another theme issue. I see you are on v6. I am wondering if there are issues between the two versions. I'll take a better look at this tomorrow.

Bootta11 commented 1 day ago

472 is around another theme issue. I see you are on v6. I am wondering if there are issues between the two versions. I'll take a better look at this tomorrow.

Great, thank you. I already created PR with quick fix, you can check it.