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

Store.custom crash in production #693

Open
felipealmeidacorrea opened this issue Jan 20, 2025 · 0 comments
Open

Store.custom crash in production #693

felipealmeidacorrea opened this issue Jan 20, 2025 · 0 comments
Labels

Comments

@felipealmeidacorrea
Copy link

felipealmeidacorrea commented Jan 20, 2025

The issue originated in PR #683 involves an "Invalid Hook Call" error. This error occurs because the useIntl hook from the react-intl library was being called inside the getFilters function, which is not a React functional component or a custom Hook.

React hooks, including useIntl, must only be used within functional components or custom hooks as per the Rules of Hooks. Violating these rules leads to runtime errors, particularly during rendering, as observed in this case. This error affects both server-side rendering (SSR) and client-side rendering processes, causing application instability.

To Reproduce
Go to any page using a store.custom template that has productClusterIds as prop.

Expected behavior
It was supposed to show the products without the error mentioned

Screenshots

Image

Desktop environment:

Additional context
The error is located in lines 35 and 36 of the file react/utils/getFilters.js, where the useIntl hook is improperly called outside the context of a React functional component or custom hook.

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

No branches or pull requests

1 participant