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

Fails compilation in swc's strict mode #644

Closed
DecentM opened this issue Jul 10, 2023 · 0 comments
Closed

Fails compilation in swc's strict mode #644

DecentM opened this issue Jul 10, 2023 · 0 comments

Comments

@DecentM
Copy link

DecentM commented Jul 10, 2023

It looks like swc doesn't allow the keyword arguments in strict mode, and type-fest causes this error when building. Instead of failing the build, the expected behaviour is that the build continues.

    ✖  nx run my-package:build
       Compiling with SWC for my-package...
       
         x 'eval' and 'arguments' cannot be used as a binding identifier in strict mode
           ,-[my-package/node_modules/type-fest/source/partial-on-undefined-deep.d.ts:55:1]
        55 | /**
        56 | Utility type to get the value type by key and recursively call `PartialOnUndefinedDeep` to transform sub-objects.
        57 | */
        58 | type PartialOnUndefinedDeepValue<T, Options extends PartialOnUndefinedDeepOptions> = T extends BuiltIns | ((...arguments: any[]) => unknown)
           :                                                                                                                ^^^^^^^^^
        59 |    ? T
        60 |    : T extends ReadonlyArray<infer U> // Test if type is array or tuple
        61 |            ? Options['recurseIntoArrays'] extends true // Check if option is activated
           `----

Manually editing type-fest in node_modules to use some other name for the arguments fixes this issue.

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
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 a pull request may close this issue.

1 participant