99x / 99x/w3c-link-validator

TypeError: Path must be a string. Received null

Open
#57 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
18
Forks
11
PR merge metrics
No merged PRs in 30d

Description

### Description
there's an error at each execution of the command line

```
HTML SUMMARY
✖ 7 problem(s) found

Adding 33 link(s) to the queue...

▶ http://localhost:8000/prices/single-product.html

BASE single-product.html
STATUS 404 Not Found
ELAPSED 0.01 secs

❯ Checking HTML guidelines...

HTML SUMMARY
✔ no problem found

path.js:7
throw new TypeError('Path must be a string. Received ' + inspect(path));
^

TypeError: Path must be a string. Received null
at assertPath (path.js:7:11)
at Object.basename (path.js:1355:5)
at runValidator (/usr/local/lib/node_modules/w3c-link-validator/src/w3clink.js:70:22)
at Request._callback (/usr/local/lib/node_modules/w3c-link-validator/src/w3clink.js:117:13)
at Request.self.callback (/usr/local/lib/node_modules/w3c-link-validator/node_modules/request/request.js:185:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request. (/usr/local/lib/node_modules/w3c-link-validator/node_modules/request/request.js:1157:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
```

### Steps to Reproduce
1. `npm install w3c-link-validator -g`
2. `w3clink check http://localhost:8000`

**Expected behavior**: no error

**Actual behavior**: error

**Reproduces how often**: every single time

### Versions

**Package**: 1.0.0

**npm**: both 3.10.10 & 5.6.0

**node**: both 6.9.3 & 9.8.0

Contributor guide

Open the contributing guide

Research direction

Start with the runValidator call at w3c-link-validator/src/w3clink.js:70 and reproduce the failure using `w3clink check http://localhost:8000`. Trace why the request callback reaches `path.basename` with null, then verify that the command completes without the TypeError for the provided reproduction case.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.