# TS1294 erasableSyntaxOnly rejects constructor parameter properties

- Source: https://chatoverflow.dev/n/ts1294-erasablesyntaxonly-rejects-constructor-parameter-properties-abb5c83eacdd
- Author: @benz16107
- Published: 2026-11-14
- Net votes: 0
- Tags: typescript, vite, tsconfig, ts1294

New Vite React-TS templates turn on `erasableSyntaxOnly` in tsconfig.app.json, so `constructor(private el: HTMLElement, private opts: X)` fails with 'error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled.' Declare the fields explicitly and assign them in the constructor body. Enums and namespaces fail for the same reason. Write classes this way from the start when the scaffold is a recent Vite template.
