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

LF-4718: fix web deploy tsc error #3679

Merged
merged 3 commits into from
Feb 5, 2025

Conversation

antsgar
Copy link
Collaborator

@antsgar antsgar commented Feb 3, 2025

Description

Fixes tsc error that causes web deploy fail after merging TS PR.

Jira link:

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Passes test case
  • UI components visually reviewed on desktop view
  • UI components visually reviewed on mobile view
  • Other (please explain)

Checklist:

  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • The precommit and linting ran successfully
  • I have added or updated language tags for text that's part of the UI
  • I have added "MISSING" for all new language tags to languages I don't speak
  • I have added the GNU General Public License to all new files

@antsgar antsgar requested review from a team as code owners February 3, 2025 22:58
@antsgar antsgar requested review from SayakaOno and kathyavini and removed request for a team February 3, 2025 22:58
Copy link
Collaborator

@kathyavini kathyavini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<MeatballsMenu /> looks good -- isn't erroring for me anymore -- but I still see an IDE error and pnpm build crash on <FileSizeExceedModal /> -- do you see that one?

src/components/Modals/FileSizeExceedModal/index.tsx:21:7 - error TS2322: Type 'string | number | boolean | object | TFunctionDetailedResult<string> | (string | object)[] | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<...> | ReactPortal | null | undefined' is not assignable to type 'NonNullable<ReactNodeLike>'.
  Type 'undefined' is not assignable to type 'NonNullable<ReactNodeLike>'.

21       title={t(`FILE_SIZE_MODAL.TITLE`)}
         ~~~~~

  src/components/Modals/ModalComponent/v2/index.jsx:75:3
    75   title: PropTypes.node.isRequired || PropTypes.string.isRequired,
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The expected type comes from property 'title' which is declared here on type 'IntrinsicAttributes & Pick<{ title: any; titleClassName: any; icon: any; contents: any; dismissModal: any; buttonGroup: any; children: any; warning: any; error: any; tooltipContent: any; className?: string | undefined; }, "className"> & Pick<...> & Pick<...>'

In order to see any errors at all I had to do a fresh node_modules install though on integration. Probably it was a version bump in some @types package or other (@types/react or maybe a MUI thing?) that introduced this error, right?

@@ -13,7 +13,7 @@ import { BsX } from 'react-icons/bs';
import { Close } from '@mui/icons-material';

export default function ModalComponent({
title,
title = '',
Copy link
Collaborator

@kathyavini kathyavini Feb 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This solves the issue for me in that file, but I get a different tsc error in components/Drawer on build 😂

src/components/Drawer/index.tsx:69:7 - error TS2322: Type 'NonNullable<ReactNode>' is not assignable to type 'string | undefined'.
  Type 'number' is not assignable to type 'string'.

69       title={title}
         ~~~~~


Found 1 error in src/components/Drawer/index.tsx:69

I appreciate that you are actually solving the errors, though, I would have so totally used // @ts-ignore 😅

@antsgar antsgar requested a review from kathyavini February 5, 2025 15:46
Copy link
Collaborator

@kathyavini kathyavini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

Copy link
Collaborator

@SayakaOno SayakaOno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worked for me too, thank you!

@SayakaOno SayakaOno added this pull request to the merge queue Feb 5, 2025
Merged via the queue into integration with commit 0f8a278 Feb 5, 2025
4 of 5 checks passed
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 this pull request may close these issues.

3 participants