Back
Private identifiers are only available when targeting ECMAScript 2015 and higher.
- 0
- Self Hosted
- Functions
Hello folks, hope you all doing fine.
Have any of you faced the error below?
TypeScript
node_modules/node-appwrite/dist/id.d.ts:2:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
2 #private;
~~~~~~~~```
I am using node-appwrite v13.0.0. Basically if I import anything from node-appwrite I will have that error when using `npx tsc main.ts`
My tsconfig.json is as below:
```json
{
"compilerOptions": {
"target": "ES2022",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"outDir": "./dist",
"rootDir": "./src", // Diretório raiz dos arquivos de entrada
"resolveJsonModule": true, // Permite a importação de arquivos JSON
"moduleResolution": "node", // Usa a resolução de módulos do Node.js
"allowSyntheticDefaultImports": true, // Permite importações padrão sintéticas
"noImplicitAny": true, // Erro em expressões e declarações com tipo implícito "any"
"noImplicitThis": true, // Erro quando "this" tem tipo implícito "any"
"strictNullChecks": true, // Habilita verificações estritas de null
"strictFunctionTypes": true, // Habilita verificações estritas de tipos de função
"strictBindCallApply": true, // Verifica a compatibilidade de argumentos em chamadas de função
"noEmitOnError": true // Não emite arquivos se houver erros de compilação
},
"include": ["src/**/*"], // Inclui todos os arquivos TypeScript no diretório src
"exclude": ["node_modules", "**/*.test.ts"] // Exclui a pasta node_modules e arquivos de teste
}```
Sample of code that will throw the error:
```ts
import { Client, Databases, Account } from 'node-appwrite'
const client = new Client()
console.log(client)
Is there anything I can do on my side to get rid of this error?
TL;DR
Private identifiers are only available in ECMAScript 2015 and higher, causing an error in node-appwrite. The solution is to set the "target" option in tsconfig.json to "ES2015" or higher.Recommended threads
- Authentication on custom Websocket Serve...
Hi, I want to use a custom Websocket Server (using Bun) for my application. However I cant really figure out authentication on custom servers. Session cookies ...
- Realtime: Listener not triggered on upda...
I self host appwrite 1.8.1. The genereal functionallity works fine. But my realtime subscription isn't updating. I see "Received heartbeat response from realtim...
- TablesDB can't be used in Appwrite Funct...
I have written a function (DART) and it won't deploy. Here is what I get : 2026-03-14T17:09:41.459693680Z Compiling ... 2026-03-14T17:09:42.915619217Z ../build...