"TriangleCreateTool is not a constructor" error while create custom annotation

Detailed description of issue
I get the following error while creating custom annotation while following this guide https://pdfjs.express/documentation/annotation/custom-annotations
I am using Angular 9 to load the WebViewer

Can you please provide angular sample or guide for custom annotations if possible?

Link to document
Here’s my config file for the custom annotation
myConfig.zip (1.1 KB)

Code snippet
This is how I am calling the config file in my WebViewer
path: “…/lib/public”,
config: “…/assets/myConfig.js”,


Sorry for the delay here, I was on vacation when this was posted and it was missed.

When creating your triangle tool, make sure to use function syntax and not fat arrow syntax.

const TriangleCreateTool = function() { ... }

There is an error in our documentation where we use an arrow function here instead. We will fix this ASAP.