question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error 2488 only shown once

See original GitHub issue

Bug Report

When the error Type '{type}[] | undefined' must have a '[Symbol.iterator]()' method that returns an iterator.(2488) occurs multiple times in a project it only shows once.

image As could be seen in the image above only data_1 has red underline, while I expect to also have red underline by data_2.

🕗 Version & Regression Information

When using es5 or older both errors are shown, but from es6 only one error shows.

⏯ Playground Link

Playground link with example

💻 Code

// using math.random to create type string[] or undefined
const data: string[] | undefined = Math.random() ? [] : undefined;

const data_1 = [...data]; // has a error shown
const data_2 = [...data]; // has no error shown

🙁 Actual behavior

The TypeScript compiler is only returning one of the multiple errors when the error is of type 2488.

🙂 Expected behavior

The TypeScript compiler should return all the locations of the errors, even if they are the same type. This would be handy for code analysis tools.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:4
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
danny12321commented, Oct 11, 2021

Even when ignoring the first error the second will still not show. This makes compiling with compile errors (that are not showing) possible. image

But when creating a copy both errors show which is interesting. image

0reactions
nicojscommented, Dec 10, 2022

Thanks for the response @RyanCavanaugh 🙏.

Also without the @ts-expect-error family of problems here, tools/users might rely on full error reporting. I believe that is also a design goal.

We at StrykerJS rely on a full error report in order to validate multiple mutants at the same time in https://github.com/stryker-mutator/stryker-js/pull/3900.

Read more comments on GitHub >

github_iconTop Results From Across the Web

2488 ERROR Invalid ShipmentSpecialServiceType [Solution]
This error is shown when you are trying to process an order using FedEx One Rate, but either: FedEx One Rate is not...
Read more >
TASCAM 2488 - Error and status messages (v1.00)
If you are using a 2488 with the version 1.00 operat- ing system (as shown when you power up the unit), use the...
Read more >
How to fix Error 2488 (You can't use the ApplyFilter action on ...
Runtime Code 2488 happens when Microsoft Access fails or crashes whilst it's running, hence its name. It doesn't necessarily mean that the code...
Read more >
Used 2488 nightmare - TASCAM Forums
First of all: the 2488 is not damaged. The error codes are typical for HDD issues. Best thing is you get a new...
Read more >
Error Message 2488 - Forums - access-programmers.co.uk
Hi, I have a form with a series of unbound combo boxes to build a search string in the form header. I also...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found