Skip to content
This repository has been archived by the owner on Dec 27, 2024. It is now read-only.

🐛 Bug Report: theme.spacing is not function on announcements/create page #492

Closed
1 task done
NRisticHtec opened this issue Nov 14, 2024 · 14 comments
Closed
1 task done
Assignees
Labels
bug An issue with the system

Comments

@NRisticHtec
Copy link
Contributor

📜 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?

  • I checked and didn't find similar issue

Are you willing to submit PR?

None

@NRisticHtec NRisticHtec added the bug An issue with the system label Nov 14, 2024
@kurtaking
Copy link
Member

#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
Copy link

#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.

@Bootta11
Copy link

Any updates on this?

@zeshanziya
Copy link

I faced the same issue. I reverted to version 0.10.5, and it's working fine now.

@Sarabadu
Copy link

Sarabadu commented Dec 6, 2024

same here, seems like the bug was introduced in version >=0.11

@kurtaking
Copy link
Member

@Bootta11 @zeshanziya @Sarabadu - #493 will be approved and in the next release

@kurtaking kurtaking self-assigned this Dec 6, 2024
@kurtaking
Copy link
Member

kurtaking commented Dec 9, 2024

@Bootta11 @zeshanziya @Sarabadu - The latest release is out. Let me know how things look once you update. I'll close this out when I hear back.

@zeshanziya
Copy link

@kurtaking Thanks. Its fixed. I updated to latest release and its working fine.

@NRisticHtec
Copy link
Contributor Author

@kurtaking Look like error is fixed.

But now I found styling problems:
Announcements item menu
Delete dialog

@kurtaking
Copy link
Member

I think the best route right now is reverting the upgrade to MUI v5 😢 . It's caused too many issues, and these changes only provide bandaids to the solution.

@NRisticHtec
Copy link
Contributor Author

@kurtaking I agree, that should be best option till proper MUI v5 upgrade implemented.

@kurtaking
Copy link
Member

kurtaking commented Dec 16, 2024

X-posting this message. PR to revert back to MUI v4 will also remove the changes made for this issue.

@kurtaking
Copy link
Member

X-posting this message. PR to revert back to MUI v4 will also remove the changes made for this issue.

Looking for reviews on the PR if anyone is interested.

@kurtaking
Copy link
Member

Revert to mui 4 has been completed. closing

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug An issue with the system
Projects
None yet
Development

No branches or pull requests

5 participants