# TypeScript repos stuck on es2019

**URL:** <https://community.palantir.com/t/typescript-repos-stuck-on-es2019/519>\
**Category:** Ask the Community\
**Tags:** functions\
**Created:** [June 25, 2024, 4:29pm UTC](https://community.palantir.com/t/typescript-repos-stuck-on-es2019/519 "2024-06-25T16:29:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CodeStrap](https://yyz1.discourse-cdn.com/palantir/user_avatar/community.palantir.com/codestrap/32/138_2.png) [@CodeStrap](https://community.palantir.com/u/CodeStrap)\
**Post date:** [June 25, 2024, 4:29pm UTC](https://community.palantir.com/t/typescript-repos-stuck-on-es2019/519/1 "2024-06-25T16:29:36Z")

</div>

I can’t use modern javascript features in TypeScript repos. If I attempt to use es2020 or esnext I get errors setting up the workspace. This prevents me from using any libraries that include things like null coelessing operators and other modern language features. Below is a sample error that is triggered by ??.

```auto
{
 "errorCode": "INVALID_ARGUMENT",
 "errorInstanceId": "a24688dd-7e0d-4051-9928-41473fd32854",
 "errorName": "Functions:CompileFailed",
 "parameters": {
  "stdout": "./node_modules/xstate/dist/xstate.esm.js 276:42\nModule parse failed: Unexpected token (276:42)\nYou may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders\n| systemId\n| } = invokeConfig;\n> const resolvedId = invokeConfig.id ?? createInvokeId(this.id, i);\n| const resolvedSrc = typeof src === 'string' ? src : xstate.invoke.${createInvokeId(this.id, i)};\n| return {\n @ ./src/machines/SemanticSearch.ts 4:17-34\n @ ./src/machines/index.ts\n @ ./src/SemanticSearch.ts\n @ ./src/index.ts\n/scratch/standalone/c9a57dae-5339-4ada-ac2e-73e7fb776683/code-assist/contents/functions-typescript/src/machines/SemanticSearch.ts\n./src/machines/SemanticSearch.ts 34:21-80:5\n[tsl] ERROR in /scratch/standalone/c9a57dae-5339-4ada-ac2e-73e7fb776683/code-assist/contents/functions-typescript/src/machines/SemanticSearch.ts(34,22)\n TS2554: Expected 0 arguments, but got 1.\n/scratch/standalone/c9a57dae-5339-4ada-ac2e-73e7fb776683/code-assist/contents/functions-typescript/node_modules/xstate/dist/declarations/src/setup.d.ts\n[tsl] ERROR in /scratch/standalone/c9a57dae-5339-4ada-ac2e-73e7fb776683/code-assist/contents/functions-typescript/node_modules/xstate/dist/declarations/src/setup.d.ts(54,21)\n TS1139: Type parameter declaration expected.\n/scratch/standalone/c9a57dae-5339-4ada-ac2e-73e7fb776683/code-assist/contents/functions-typescript/node_modules/xstate/dist/declarations/src/setup.d.ts\n[tsl] ERROR in /scratch/standalone/c9a57dae-5339-4ada-ac2e-73e7fb776683/code-assist/contents/functions-typescript/node_modules/xstate/dist/declarations/src/setup.d.ts(54,27)\n TS1005: ';' expected.\n/scratch/standalone/c9a57dae-5339-4ada-ac2e-73e7fb776683/code-assist/contents/functions-typescript/node_modules/xstate/dist/declarations/src/setup.d.ts\n[tsl] ERROR in /scratch/standalone/c9a57dae-5339-4ada-ac2e-73e7fb776683/code-assist/contents/functions-typescript/node_modules/xstate/dist/declarations/src/setup.d.ts(54,35)\n TS1128: Declaration or statement expected.\n/scratch/standalone/c9a57dae-5339-4ada-ac2e-73e7fb776683/code-assist/contents/functions-typescript/node_modules/xstate/dist/declarations/src/setup.d.ts\n[tsl] ERROR in /scratch/standalone/c9a57dae-5339-4ada-ac2e-73e7fb776683/code-assist/contents/functions-typescript/node_modules/xstate/dist/declarations/src/setup.d.ts(54,409)\n TS1005: ')' expected.\n/scratch/standalone/c9a57dae-5339-4ada-ac2e-73e7fb776683/code-assist/contents/functions-typescript/node_modules/xstate/dist/declarations/src/setup.d.ts\n[tsl] ERROR in /scratch/standalone/c9a57dae-5339-4ada-ac2e-73e7fb776683/code-assist/contents/functions-typescript/node_modules/xstate/dist/declarations/src/setup.d.ts(54,411)\n TS1434: Unexpected keyword or identifier.\n/scratch/standalone/c9a57dae-5339-4ada-ac2e-73e7fb776683/code-assist/contents/functions-typescript/node_modules/xstate/dist/declarations/src/setup.d.ts\n[tsl] ERROR in /scratch/standalone/c9a57dae-5339-4ada-ac2e-73e7fb776683/code-assist/contents/functions-typescript/node_modules/xstate/dist/declarations/src/setup.d.ts(54,418)\n TS1128: Declaration or statement expected.\n/scratch/standalone/c9a57dae-5339-4ada-ac2e-73e7fb776683/code-assist/contents/functions-typescript/node_modules/xstate/dist/declarations/src/setup.d.ts\n[tsl] ERROR in /scratch/standalone/c9a57dae-5339-4ada-ac2e-73e7fb776683/code-assist/contents/functions-typescript/node_modules/xstate/dist/declarations/src/setup.d.ts(54,420)\n TS1128: Declaration or statement expected.\n/scratch/standalone/c9a57dae-5339-4ada-ac2e-73e7fb776683/code-assist/contents/functions-typescript/node_modules/xstate/dist/declarations/src/setup.d.ts\n[tsl] ERROR in /scratch/standalone/c9a57dae-5339-4ada-ac2e-73e7fb776683/code-assist/contents/functions-typescript/node_modules/xstate/dist/declarations/src/setup.d.ts(55,1)\n TS1128: Declaration or statement expected.",
  "stderr": ""
 }
}

```

If there is a workaround, let me know.

---

<div class="post-metadata">

**Author:** ![timurm](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@timurm](https://community.palantir.com/u/timurm)\
**Post date:** [June 25, 2024, 6:27pm UTC](https://community.palantir.com/t/typescript-repos-stuck-on-es2019/519/2 "2024-06-25T18:27:12Z")

</div>

Hi @CodeStrap ,

This is a limitation of the TypeScript functions Webpack configuration, which uses Webpack 4. We are in the process of upgrading repositories to Webpack 5, which supports newer language features like nullish coalescing. We expect to start rolling out the upgrade in the coming weeks.

---

<div class="post-metadata">

**Author:** ![timurm](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@timurm](https://community.palantir.com/u/timurm)\
**Post date:** [July 19, 2024, 12:48am UTC](https://community.palantir.com/t/typescript-repos-stuck-on-es2019/519/3 "2024-07-19T00:48:41Z")

</div>

TypeScript repositories now support Webpack 5, which you can gain access to by upgrading your master branch to the latest version in authoring. Please let us know if you run into any more issues.
