Forum Bugs

unexpected token reserved("const")

I think this is about ES2015(ES6) problem.

Prince cannot recognize ES6 syntax maybe.

const state = {
activateDownload: false,
toastVisible: false,
toastMessage: '',
toastState: false,
useGNB: true

is there a plan to fix this problem?
Correct, Prince does not support ES6 at this time. We may fix this in the future, but not in the short term.
Any updated plans to support ES6?

Try DocRaptor - PrinceXML web service and official PrinceXML partner

Not yet, but it's something we should think about for 2021. Are there any particular scripts or language features that come up repeatedly?
Hello Mike,

Alex from DocRaptor support here.

Figure I'll chime in as well since I encounter ES6 concerns in our support queues.

let, Set, Map, and const come up a lot in support inquiries - or at least, they're indicators someone is using ES6+ features and for us to suggest alternatives to them. Functional utilities such as map, reduce, Array.sort, Array.filter, etc. are also commonly used.

Would be great if ES6+ in PrinceXML "just worked". Could make everyone happy both now and in the future (when software vendors inevitably drop ES5 backwards compatibility, which has already occurred with some software libraries).
The mentioned array methods are supported - sort, filter, map and reduce :)

Otherwise this looks like a good shortlist, think the only thing I'd add is arrow functions (=>) which I expect to start showing up about now, since IE11 is the only major thing without support at this point.

Announcement: repos for tests/utils