Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore returning undefined #305

Closed
TylerJang27 opened this issue Mar 11, 2024 · 2 comments
Closed

ignore returning undefined #305

TylerJang27 opened this issue Mar 11, 2024 · 2 comments

Comments

@TylerJang27
Copy link

Overview

Running markdown-link-check -q basic.in.md with basic.in.md contents:

[Good link](#test-header)
[Good link](https://www.google.com)
[Bad link](#bad-header)
[Bad link](https://nowhere.com/bad-link)


## test-header

outputs exit code 1 and output:

/home/tyler/.cache/trunk/tools/markdown-link-check/3.12.0-2ce3b62d69f45d7b221989693fd6ca21/node_modules/markdown-link-check/markdown-link-check:97
                    if (program.opts().ignore.some((ignorePath) => resolved.includes(ignorePath))) {
                                             ^

TypeError: Cannot read properties of undefined (reading 'some')
    at Command.<anonymous> (/home/tyler/.cache/trunk/tools/markdown-link-check/3.12.0-2ce3b62d69f45d7b221989693fd6ca21/node_modules/markdown-link-check/markdown-link-check:97:46)
    at Command.listener [as _actionHandler] (/home/tyler/.cache/trunk/tools/markdown-link-check/3.12.0-2ce3b62d69f45d7b221989693fd6ca21/node_modules/commander/lib/command.js:482:17)
    at /home/tyler/.cache/trunk/tools/markdown-link-check/3.12.0-2ce3b62d69f45d7b221989693fd6ca21/node_modules/commander/lib/command.js:1283:65
    at Command._chainOrCall (/home/tyler/.cache/trunk/tools/markdown-link-check/3.12.0-2ce3b62d69f45d7b221989693fd6ca21/node_modules/commander/lib/command.js:1177:12)
    at Command._parseCommand (/home/tyler/.cache/trunk/tools/markdown-link-check/3.12.0-2ce3b62d69f45d7b221989693fd6ca21/node_modules/commander/lib/command.js:1283:27)
    at Command.parse (/home/tyler/.cache/trunk/tools/markdown-link-check/3.12.0-2ce3b62d69f45d7b221989693fd6ca21/node_modules/commander/lib/command.js:909:10)
    at getInputs (/home/tyler/.cache/trunk/tools/markdown-link-check/3.12.0-2ce3b62d69f45d7b221989693fd6ca21/node_modules/markdown-link-check/markdown-link-check:108:7)
    at main (/home/tyler/.cache/trunk/tools/markdown-link-check/3.12.0-2ce3b62d69f45d7b221989693fd6ca21/node_modules/markdown-link-check/markdown-link-check:252:20)

Node.js v20.11.0

markdown-link-check version

3.12.0 (this does not happen on any earlier versions). The same happens on 3.12.1

Node.js version

v18.12.1 (the same happens on v20.11.0)

OS

Ubuntu 20.04.6 LTS

Notes

This may have a similar root cause to #304, although the symptoms seem different.

@dklimpel
Copy link
Contributor

The same happens on 3.12.1

Is it the same error on 3.12.1?

This line of code if (program.opts().ignore.some((ignorePath) => resolved.includes(ignorePath))) {
does not exists anymore in 3.12.1.

@TylerJang27
Copy link
Author

My mistake. This is in fact fixed in 3.12.1. I was relying on my script that I thought had run on 3.12.1, but turns out it missed the release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants