Default property values lost after migrating from Babel
Unanswered
Mrigal carp posted this in #help-forum
Mrigal carpOP
Hi, I am migrating from Babel to SWC on my NextJS project (https://game-park.com)
Everything works like a charm except for TypeGraphQL which is no longer able to read the classes default property values: https://github.com/MichalLytek/type-graphql/discussions/1694#discussioncomment-9560254
TypeGraphQL dev said: "TypeGraphQL uses a trick to detect default values. It creates a new instance of the class and then reads the instance's property value.
I have no experience to tell what settings SWC needs"
Do you have a clue why this trick does not work with SWC?
I asked on SWC Discord and they told me to set
Everything works like a charm except for TypeGraphQL which is no longer able to read the classes default property values: https://github.com/MichalLytek/type-graphql/discussions/1694#discussioncomment-9560254
TypeGraphQL dev said: "TypeGraphQL uses a trick to detect default values. It creates a new instance of the class and then reads the instance's property value.
I have no experience to tell what settings SWC needs"
Do you have a clue why this trick does not work with SWC?
I asked on SWC Discord and they told me to set
usedefineforclassfields option in .swcrc, but I cannot do that in a NextJS project.