When version > 2.4, Failed to Connect to the Backend Error: pkgJson.main?.endsWith is not a function

Open Beginner friendly
#219 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
67/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
node.js, typescript
Domain
devtools

Research direction

Start by searching the codebase for pkgJson.main?.endsWith and trace how package metadata is read in the backend. Reproduce the failure with npx node-modules-inspector using the reported setup, then check nearby tests for package entry handling. Done when the backend connects without this error for the reported case and relevant tests pass.

Written by the indexing model from the issue text.

Description

Describe the bug

When version > 2.4, Failed to Connect to the Backend Error: pkgJson.main?.endsWith is not a function

Reproduction

npx node-modules-inspector

System Info
System:
    OS: Windows 10 10.0.17763
  Binaries:
    Node: 22.22.3
    npm: 10.9.8
  Browsers:
    Chrome: 157.0.8103.51
Used Package Manager

npm

Validations
  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
Contributions
  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests (actually just go ahead and do it, thanks!)
Dominant language
TypeScript
Stars
3k
Forks
92
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from antfu/node-modules-inspector

All issues in antfu/node-modules-inspector

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.