Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"error TS1110: Type expected" when using export type

When trying to use grunt-typescript to compile my TS files, I'm getting the following error:

error TS1110: Type expected.

on each of these three lines

export type AttributeWriteType = "Append" | "Replace" | "Static";
export type Action = "Create" | "Delete";
export type Status = "Created" | "Queued" | "Running" | "Completed" | "Expired";

I'm fairly new to Typescript, so any insight would be greatly appreciated.

like image 432
Cineris Avatar asked Jan 07 '23 00:01

Cineris


2 Answers

This is caused by grunt-typescript having an out-of-date version of the TypeScript compiler. Check your package.json to ensure you're using a current version of the typescript package.

like image 75
Ryan Cavanaugh Avatar answered Feb 04 '23 02:02

Ryan Cavanaugh


It looks like grunt-typescript isn't being supported anymore, so the TS compiler it uses is out of date.

I switched to using grunt-ts instead, and it is working as intended.

like image 27
Cineris Avatar answered Feb 04 '23 02:02

Cineris