0

Environment: SP2019 onprem

SPFx version: 1.4.1

All of sudden below error is coming while doing gulp build or gulp serve.

A tuple type element list cannot be empty.Error - typescript - src/webparts/displayStateInformation/components/DisplayStateInformation.tsx(14,4): error TS1122: A tuple type element list cannot be empty.

How to resolve this?

Below is my interface

export interface IItemsData {
  k:[];
}

Error throwing for property k

  • Can you please add the code in DisplayStateInformation.tsx file to your question? – Ganesh Sanap Aug 21 at 6:27
  • i have added the interface where it is throwing error – Mihir Aug 21 at 6:34
  • What are you storing in array? Strings?Numbers? – Ganesh Sanap Aug 21 at 6:42
0

If you are storing it as an array of string then try using below code:

export interface IItemsData {
   k: string[];
}
  • 1
    Yeah correct. but strange thing is this code is working in another machine without any error. If i clone the repository and do the build it is throwing error. Really hard to adjust with this node and npm :) – Mihir Aug 21 at 7:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.