w3c-link-validator icon indicating copy to clipboard operation
w3c-link-validator copied to clipboard

TypeError: Path must be a string. Received null

Open fredericrous opened this issue 7 years ago • 1 comments

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.<anonymous> (/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

fredericrous avatar May 29 '18 09:05 fredericrous

I get this error when the href has a mailto:

rootUrl mailto:[email protected]
urlinfo Url {
  protocol: 'mailto:',
  slashes: null,
  auth: 'support',
  host: 'domain.com',
  port: null,
  hostname: 'domain.com',
  hash: null,
  search: null,
  query: null,
  pathname: null,
  path: null,
  href: 'mailto:[email protected]' }

ArthurClemens avatar Jan 15 '19 19:01 ArthurClemens