Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix missing render path error #354

Merged
merged 6 commits into from
Jun 30, 2021
Merged

Fix missing render path error #354

merged 6 commits into from
Jun 30, 2021

Conversation

marchersimon
Copy link
Contributor

I tried fixing another uncaught error, when running tldr --render without a path. Insead of getting

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received type boolean (true)
    at readFile (node:fs:351:10)
    at go$readFile (/usr/lib/node_modules/tldr/node_modules/graceful-fs/graceful-fs.js:118:14)
    at Object.readFile (/usr/lib/node_modules/tldr/node_modules/graceful-fs/graceful-fs.js:115:12)
    at /usr/lib/node_modules/tldr/node_modules/universalify/index.js:10:14
    at new Promise (<anonymous>)
    at Object.readFile (/usr/lib/node_modules/tldr/node_modules/universalify/index.js:7:14)
    at Tldr.render (/usr/lib/node_modules/tldr/lib/tldr.js:76:15)
    at Object.<anonymous> (/usr/lib/node_modules/tldr/bin/tldr:104:12)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10) {
  code: 'ERR_INVALID_ARG_TYPE'
}

I now get

/home/simon/Desktop/tldr-node-client/bin/tldr:112
    throw new MissingRenderPathError();
    ^

MissingRenderPathError: Option --render needs an argument.
    at Object.<anonymous> (/home/simon/Desktop/tldr-node-client/bin/tldr:112:11)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Function.Module._load (node:internal/modules/cjs/loader:828:14)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
    at node:internal/main/run_main_module:17:47 {
  code: 4
}

I know it's not much, but maybe a start. Feel free to close the PR if it isn't helpful.

Copy link
Collaborator

@vladimyr vladimyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it's not much, but maybe a start. Feel free to close the PR if it isn't helpful.

Quality matters more than quantity 😉 and looking from that perspective this is certainly a good effort 👍

Co-authored-by: Dario Vladović <d.vladimyr@gmail.com>
@vladimyr
Copy link
Collaborator

LGTM I believe it is ready for prime time by removing draft status 😉

@marchersimon marchersimon marked this pull request as ready for review May 21, 2021 12:02
Co-authored-by: bl-ue <54780737+bl-ue@users.noreply.github.com>
@marchersimon
Copy link
Contributor Author

Do you think this can already be merged? The output is still pretty long:

Desktop/tldr-node-client/lib/tldr.js:77
      throw new MissingRenderPathError();
      ^

MissingRenderPathError: Option --render needs an argument.
    at Tldr.render (/home/simon/Desktop/tldr-node-client/lib/tldr.js:77:13)
    at Object.<anonymous> (/home/simon/Desktop/tldr-node-client/bin/tldr:111:12)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Function.Module._load (node:internal/modules/cjs/loader:828:14)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
    at node:internal/main/run_main_module:17:47 {
  code: 4
}

@marchersimon
Copy link
Contributor Author

Any updates on this?

@agnivade
Copy link
Member

You are welcome to merge this by yourself, or let me know, I am happy to do it.

@marchersimon marchersimon merged commit f1a4854 into tldr-pages:master Jun 30, 2021
@marchersimon marchersimon deleted the fix-render-path-error branch June 30, 2021 16:28
vladimyr added a commit that referenced this pull request Jun 30, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants