-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Upgraded marked lib dependency at the JSDoc 3.6.7 release is broken on nodejs <= 14 #1926
Comments
@hegemonic can you look at this please? |
Note that marked is very flaky with node support. Don't trust the package.json. They say they support "latest and LTS versions of Node.js" which changes with time, wheras their major versions do not. Seems like to avoid a breaking change here we can assume that marked is no longer node 8.15 compatible from this point and just pin it to the last version. Do note that some of the older versions don't support node 8 either. There was a change to a regex which includes unicode matches and that doesn't work until node 10. Either way, anything that consumes marked now ends up "inheriting" it's flaky node support unless it gets pinned. EDIT: I see JSDOC now drops node 10 support in 4.x, but this impacts 3.x too. |
Well, I don't trust their (marked) package.json. It's just misleading at the moment. Landing the security fixes as they come is good. However to me it appears, the marked upgrading was kinda a blind shot, the author may have not expected such a surprise. And dropping the breaking changes at the patch version update should not happen while one complies to sevmer. Otherwise it should be claimed. |
@alasdairhurst so this should be fixed according to markedjs/marked#2109 |
@alexbakum They just pushed a patch version now which removes the optional chaining (node 14 requirement) and now works and tested with node 12. (changing what was documented as support for node 8 in the package.json) Basically, they don't "interpret" change in node version support as a breaking change. (aside from what maybe 90% of the npm community thinks). Unfortunately this impacts everything upstream. Unfortunately that PR doesn't solve the problem for jsdoc :( It now means that jsdoc 3.x still works with node 12, but it should be compatible with node 8.15 |
Well, at least for node 12 (my case) the issue is solved for now. |
For maintainers they can do this: This will import the transpiled es5 version of marked and maintain node support. |
Within the 3.6.7 marked has been upgraded from v0.8 to v2 (see f7a64bd#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R24)
marked@2 claims it's compatible with nodejs@8, however that's not true due to the following:
src/marked.js
(see https://github.com/markedjs/v2.1.0/blob/master/package.json#L6)src/marked.js
uses the optional chaining syntax which is available only at nodejs@14 (MDN support table) (see https://github.com/markedjs/marked/blob/v2.1.0/src/marked.js#L158)Input code
Does not matter IMO
JSDoc configuration
Does not matter IMO
JSDoc debug output
Does not matter IMO
Expected behavior
JSDoc works at the nodejs@12 env
Current behavior
JSDoc throws
SyntaxError: Unexpected token '.'
at the nodejs@12 env.Your environment
The text was updated successfully, but these errors were encountered: