Skip to content
This repository was archived by the owner on Jun 16, 2025. It is now read-only.
This repository was archived by the owner on Jun 16, 2025. It is now read-only.

Fails with Top-Level Await #671

@karlhorky

Description

@karlhorky

Bug Description

The following files will report an unused dependency of node-fetch, seemingly because of top-level await not being supported:

index.js

import fetch from 'node-fetch';
await fetch('https://example.com');

package.json

{
  "name": "abc",
  "type": "module",
  "main": "index.js",
  "dependencies": {
    "node-fetch": "^3.0.0"
  }
}

Versions

  • node -v: v16.5.0
  • npm -v: 7.19.1
  • depcheck --version: 1.4.2 (latest)

Extra info

Any extra info you want to include. Thank you for the bug report!

BONUS POINTS: If you wish to help us debug further, the depcheck --json option will show more information. Check here in the README for documentation on json output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions