@netlify/esbuild hasn't seen a new release in 10 months, which is causing newer TypeScript code to fail to build

The specific issue I’m running into is that a Netlify Function with TypeScript dependencies (or user code) which use the const type parameter feature of TypeScript 5.0. This feature is supported as of esbuild version 0.17.15, but @netlify/esbuild is still on 0.14.39 (and the latest esbuild version is 0.18.7) :dizzy_face:

When will/can @netlify/esbuild be updated to match a more recent version of esbuild?

1 Like

We’ve shared this with the devs. We will let you know as soon as we have some information.

The devs confirmed that there are no immediate plans for updating the fork. We plan to deprecate that and instead use the upstream version directly. However, there’s no definite timeline for that.

For now, you can handle the TS compilation yourself, either with tsc or with esbuild and once that’s boiled down to a JS file, Netlify would use that to package the functions.

Hi @hrishikesh, I appreciate you following up on this! Using the upstream directly definitely sounds like the better move, so that’s great to hear. It might be good to note this current shortcoming somewhere in the Netlify documentation, though—there are a number of newer TypeScript features that are not supported consequent the fact that Netlify is using such an out-of-date version of esbuild, and I can imagine users having trouble locating the source of the problem (and therefore also the solution) when incompatibilities arise. Although of course this forum is intended to help with the discovery of issues like that.

Regardless, the alternative you suggest sounds relatively painless, so I’ll go with that as necessary.

Thanks for your help.

I’ve flagged this thread for the docs team to review.

1 Like