Skip to content

error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled #10759

Closed
@zhemaituk

Description

@zhemaituk

What you were expecting:
Build with "erasableSyntaxOnly": true compiler option completes without errors.

What happened instead:

tsc --build
node_modules/ra-core/src/dataProvider/HttpError.ts:3:9 - error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled.

3         public readonly message,
          ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/ra-core/src/dataProvider/HttpError.ts:4:9 - error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled.

4         public readonly status,
          ~~~~~~~~~~~~~~~~~~~~~~

node_modules/ra-core/src/dataProvider/HttpError.ts:5:9 - error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled.

5         public readonly body: any = null
          ~~~~~~~~~~~~~~~~~~~~~~~~~

Steps to reproduce:

  1. Enable erasableSyntaxOnly in tsconfig (or use latest https://www.npmjs.com/package/@tsconfig/vite-react, where it is enabled by detault):
{
  "extends": "@tsconfig/vite-react/tsconfig.json",
  "compilerOptions": {
    "erasableSyntaxOnly": true
  },
  "include": [
    "src"
  ]
}
  1. Run tsc --build

Environment

  • React-admin version: 5.8.2
  • Last version that did not exhibit the issue (if applicable): -
  • React version: 19.1.0
  • Browser: -
  • Stack trace (in case of a JS error): -

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions