Expected identifier but found "const"
I've been upgrading some packages and started seeing this error when running
npx convex dev
, but not when running tsc --project convex/tsconfig.json
:
I don't see this when running the Remix dev server. I can probably do at least a little more troubleshooting on my end, but wanted to know if anyone had any easy hints, suggestions or suspicions just from this information.9 Replies
Sounds like a TypeScript version mismatch, the const in generics is probably a new TS feature?
Yeah I figured, I'm on the latest version though
I just tested it also with the exact version specified in
@effect/data
's package.json
and got the same errorInteresting that there's an expect-error here https://github.com/Effect-TS/data/blob/846ba39b4c86f82394c0e63011af97d7345bd805/src/Either.ts#L506
That is interesting 😆
Hmm
So I guess not all bundlers notice that comment?
I think this error is coming from TypeScript, rather that esbuild not being able to bundle this code — could you check by trying --typecheck=disable?
Am I doing this right?
yes! you disproved my theory, perfect
OK it's esbuild! support for const type parameters was added in 0.17.5, and we're using "^0.15.16"
Also
produces
Aha!
Sounds like it's time for quick patch release, and more generally we can chew on bundler pluggability
eta on this is "after lunch"
@RJ esbuild upgrade is out in 1.1.1!
This took considerably longer because we found out developers could override the version of esbuild used for convex specifically in package.json, making it less urgent.