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

yargs issue with docuemntation version 14.0.3 #1641

Closed
akash-nx opened this issue Jun 27, 2024 · 4 comments
Closed

yargs issue with docuemntation version 14.0.3 #1641

akash-nx opened this issue Jun 27, 2024 · 4 comments

Comments

@akash-nx
Copy link

I have package.json with following entries:

"documentation": "^14.0.3",
"yargs": "^17.5.1"

when I run npm run documentation, I get below error:

[INFO] import yargs from 'yargs';
[INFO]        ^^^^^
[INFO] 
[INFO] SyntaxError: Unexpected identifier
[INFO]     at new Script (vm.js:80:7)
[INFO]     at createScript (vm.js:274:10)
[INFO]     at Object.runInThisContext (vm.js:326:10)
[INFO]     at Module._compile (internal/modules/cjs/loader.js:664:28)
[INFO]     at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
[INFO]     at Module.load (internal/modules/cjs/loader.js:600:32)
[INFO]     at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
[INFO]     at Function.Module._load (internal/modules/cjs/loader.js:531:3)
[INFO]     at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
[INFO]     at startup (internal/bootstrap/node.js:283:19)
[INFO] npm ERR! code ELIFECYCLE
[INFO] npm ERR! errno 1

If I use older version (13.2.5), documentation works. The reason behind version upgrade is - when docstring are generated for method, it doesnt parse '&' for body param. Example:
For below docstring:

@param { Required<Pick<Model1, 'name'>> & Partial<Model1> } body specification
expectation is to see below format in documentation:

body(Required<Pick<Model1, 'name'>> & Partial<Model1>) specification

but I can see:
body(any) specification

  • What version of documentation.js are you using?: 14.0.3
  • How are you running documentation.js (on the CLI, Node.js API, Grunt, other?): npm run documentation
@tmcw
Copy link
Member

tmcw commented Jun 27, 2024

What Node version are you using?

@akash-nx
Copy link
Author

@tmcw I am using v10.24.1

@tmcw
Copy link
Member

tmcw commented Jun 27, 2024

That's the cause - see the release notes of v14: https://github.com/documentationjs/documentation/blob/master/CHANGELOG.md#1400-alpha0-2022-08-05 - the minimum supported Node version is 14. There was probably a warning message when you ran npm install about this. v10 is ~3 years old and is no longer a maintenance version of Node.

@tmcw tmcw closed this as completed Jun 27, 2024
@akash-nx
Copy link
Author

akash-nx commented Jun 27, 2024

@tmcw I have updated node to latest version (v20.15.0) and still seeing same issue with documentation documentation@14.0.3

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