Skip to content

Unclosed 'new Set(' wrecks resolutions to packages in nodenext #46373

Description

  1. Create a new package

  2. npm install node-fetch (or whatever package)

  3. Set up a tsconfig.json with nodenext as the module mode.

    {"compilerOptions": {"module": "nodenext","noEmit": true,"strict": true}}
  4. Add the following code

    import*asfetchfrom"node-fetch";constb=/**/someList.filter(a=>a.startsWith("@types"))
  5. At the cursor /**/, type in new Set(

    import*asfetchfrom"node-fetch";constb=newSet(/**/someList.filter(a=>a.startsWith("@types"))
  6. Notice that the resolution to node-fetch is now borked.

  7. Complete the parentheses on the other side

    import*asfetchfrom"node-fetch";constb=newSet(someList.filter(a=>a.startsWith("@types")))/**/
  8. The resolution to node-fetch is likely still failing. If so, try to type a ;. That may fix it.

    import*asfetchfrom"node-fetch";constb=newSet(someList.filter(a=>a.startsWith("@types")));/**/

Metadata

Metadata

Labels

BugA bug in TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions