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

Weird bug report - RangeError: Maximum call stack size exceeded when building #805

Open
mvarchdev opened this issue Jan 28, 2024 · 1 comment

Comments

@mvarchdev
Copy link

mvarchdev commented Jan 28, 2024

I forked this repo "https://github.com/bottenderjs/messaging-apis" because I need to change some of functionality and overall update of packages. Fork is here: https://github.com/sunray-eu/messaging-apis-custom/blob/9cc3f6a846203ffe6833e7aac0f987e3f84a913d/packages/messaging-api-common/src/case.ts#L210 -> In this package and file, there is issue when I upgrade to latest version that I cannot solve. When I upgrade 'type-fest' until 4.7.1, it works even without changing anything. When I upgrade to 4.8.0+, then it breaks and while build it shows this: RangeError: Maximum call stack size exceeded when building.

I managed to isolate issue to messaging-api-common package and to method in link above. I found these conditions when it work or not work:

  1. It works normally until '4.7.1' (Tested literally all versions between '1.4.0' and '4.7.1')
  2. When it is on '4.8.0+' then it breaks, I isolated issue in method pascalcaseKeys in the link above. When I remove this conditional typing and set it constantly either to PascalCasedPropertiesDeep or PascalCasedProperties, it works:
O['deep'] extends true
  ? PascalCasedPropertiesDeep<T>
  : PascalCasedProperties<T>

How to reproduce?
just clone repo, set version of type-fest to 4.8.0 in messaging-api-common workspace and simply run yarn - it will run also yarn compile

My question is, if this is issue in type-fest or in implementation that code use. Also, how could I solve this with conditional checking kept?

Thanks in advance!

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • The funding will be given to active contributors.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@mvarchdev mvarchdev changed the title RangeError: Maximum call stack size exceeded when building Weird bug report - RangeError: Maximum call stack size exceeded when building Jan 28, 2024
@voxpelli
Copy link
Collaborator

Try newly released v4.10.2 and see if that helps. It dealt with such a problem in TypeScript 5.4

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

No branches or pull requests

2 participants