Next.js Discord

Discord Forum

how to switch compilers from SWC to TSC?

Unanswered
Balinese posted this in #help-forum
Open in Discord
BalineseOP
i came across something crazy, in which the SWC (NextJS default) compiler does not recognize decorators. The same snippet that worked for tsc gave me an error (playground: https://www.typescriptlang.org/play?#code/GYVwdgxgLglg9mABAGzgczQUwCYFlNQAWc2AFHAE4xoxgCGy+RJAXInWAJ4A0iA+hARRMADyhsOnAJSIA3gCh5iZYlCRYCRBUwAHZHQiYAtpjBQmxMkRgBnCV14A6Z3Qpo77LgG0AujIUqgYiCYDZwyJiOqGikAEQAMgDyAOJsAKJmmFRgaIgmzNiOsVJKQcohNlBamDYgyFUAvIiU1LQMFiSOEAzIpNY2Ti5uNlIA3KVlFeGR0XFJqYhpIjCwOXkElkUlZcraUCAUSNq19eOBAL6KgXsHR7r6hiZmHdjjl-IQ+jY2iAAqNVUAioKlAKCBoJRSP53oEAALRLB4DYkCaISp0WAQRDCSpQuSo64EW6IADkOKqJhJZxUl3eUwiUXQpH+lUc5KhJSAA) if u shorten the decorator function to the smallest possible point in SWC, you will see that the compiler does not recognize decorators. (atleast this is my conclusion, judging from the error)


my next solution is to switch compiler for my NextJS project, but google search results did not give much. so... how to switch compilers?

0 Replies