0

this is my tsconfig for a react project built without create-react-app

{
  "compilerOptions": {
    "target": "es5",
    "outDir": "lib",
    "lib": ["dom", "dom.iterable", "esnext"],
    "declaration": true,
    "declarationDir": "lib",
    "allowJs": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "react-jsx"
  },
  "include": ["src"],
  "exclude": ["node_modules", "lib"],
  "references": [{ "path": "./tsconfig.vite.json" }]
}

I am getting above error while running command vite which is supposed to spin up a dev server

Akshay Vijay Jain
  • 13,461
  • 8
  • 60
  • 73

1 Answers1

1

Solution is to update es5 to ES2015.

{
...
"target":"ES2015",
...
}
Akshay Vijay Jain
  • 13,461
  • 8
  • 60
  • 73