protobufjs / protobuf.js

Protocol Buffers for JavaScript & TypeScript.
Other
9.93k stars 1.42k forks source link

Protobufjs CLI compilation is broken with bad version of marked npm package #1623

Open utsavkapoor opened 3 years ago

utsavkapoor commented 3 years ago

protobuf.js version: 6.8.3

Protobufjs CLI compilation is broken due a version bump in marked.js which is now incompatible with node version <=14. marked.js has started using optional chaining in their code thus breaking protobuf CLI compilation

npx pbjs -p <proto files> -t static-module -w default --force-message > index.js
protobufjs/cli/node_modules/marked/src/marked.js:158
const prevRenderer = extensions.renderers?.[ext.name];
                                                                           ^
  SyntaxError: Unexpected token '.'
hanMaster commented 3 years ago

version 6.8.8 same issue can be successfully compiled only with nodejs 10.16

MickaToast commented 3 years ago

Same with latest version 6.11.2 on node v12.18.3. Error does not occur on node v14.8.0

davidcorcoran commented 3 years ago

@4eb0da has a workaround here: https://github.com/markedjs/marked/issues/2106#issuecomment-862226884