TypeError reading metadata

Open
#617 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
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
cli

Research direction

Start with AppMapBuilder.normalize in node_modules/@appland/models/dist/index.cjs and the scanner entry point in node_modules/@appland/scanner/built/cli/scan.js, then reproduce the yarn scanner scan --watch command. Done means scanning no longer throws a TypeError when reading metadata; add or run a focused test if the repository provides one.

Written by the indexing model from the issue text.

Description

[stderr] /Users/kgilpin/.nvm/nvm-exec yarn run scanner scan --watch --appmap-dir .: /Users/kgilpin/source/appland/vscode-appland/node_modules/@appland/models/dist/index.cjs:3655
    if (/^https?/.test(this.data.metadata?.git?.repository)) {
                                 ^

TypeError: Cannot read properties of undefined (reading 'metadata')
    at AppMapBuilder.normalize (/Users/kgilpin/source/appland/vscode-appland/node_modules/@appland/models/dist/index.cjs:3655:34)
    at /Users/kgilpin/source/appland/vscode-appland/node_modules/@appland/scanner/built/cli/scan.js:51:66
    at Generator.next (<anonymous>)
    at fulfilled (/Users/kgilpin/source/appland/vscode-appland/node_modules/@appland/scanner/built/cli/scan.js:5:58)
    // Remove credentials from git repository url
    if (/^https?/.test(this.data.metadata?.git?.repository)) {
      const url = new URL(this.data.metadata.git.repository);
      url.username = '';
      url.password = '';
      this.data.metadata.git.repository = url.toString();
    }
Dominant language
TypeScript
Stars
53
Forks
18
Avg merge
3d 18h
Merged PRs (30d)
8

Contributor guide

No contributing guide indexed for this repository

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 getappmap/appmap-js

All issues in getappmap/appmap-js

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.