website icon indicating copy to clipboard operation
website copied to clipboard

Error unknown field keepClassnames/keepFnames in swc config

Open kaczor6418 opened this issue 3 years ago • 3 comments

Steps to reproduce

Create swc config file and set keepClassnames and keepFnames of mangle options as described in documentation.

Results

Expected

Flags should be applied, no errors in terminal

Actual

Flags are not applied error in the console

Module build failed (from ./node_modules/swc-loader/src/index.js): Error: unknown field keepClassnames, expected one of props, topLevel, keepClassNames, keepFnNames, keepPrivateProps, ie8, safari10, reserved at line 1 column 750

Update 1

Repository with min code needed to reproduce

https://github.com/kaczor6418/swc-flags-typo

Results:

  • After running npm run build at master branch: image

  • After running npm run build at fixed-flags-names branch image

kaczor6418 avatar May 21 '22 23:05 kaczor6418

Hi @kdy1 any update here? Can you reproduce this issue?

kaczor6418 avatar May 25 '22 00:05 kaczor6418

I'm finally back to this. The email was buried deep, but I successfully resolve all new tasks.

Yes I can reproduce

kdy1 avatar Jun 28 '22 09:06 kdy1

https://play.swc.rs/?version=1.2.206&code=H4sIAAAAAAAAA0vOzyvOz0nVy8lP11AvSS0uUde05gIA9hDhIRUAAAA%3D&config=H4sIAAAAAAAAA02OzWrDQAyE30XkGOy20B58LfTWN8hFrBXH7v6hWZOY4HevNglxbuKbGc1caQd3ksDU0amU3LXthBSbO0RJKk3SocXZqaM9ycX5uRdzHw7NhJ2hCY66K2VWiNYLSyx8MUtZssDpmIvZCgwd2UP21ItLyvYc1BWdZTWZdZBiIcHH2%2FunBXxKkGckjHE8LvW9SyGrAJvEcfBSpT%2BR%2FO0ZiBxkM1T884rW1RpD6ud7rO68NX%2FRujU9wiN%2BH8bb0n%2FIW6f7MQEAAA%3D%3D

kdy1 avatar Jun 28 '22 09:06 kdy1