Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Master_T
Helper I
Helper I

Using a library that uses private fields in a custom visual

Hello everyone

I'm developing a custom visual where I want to use the PDF.js library to display a PDF document.

 

The problem I'm having is that if I include it and try to use it in my custom visual (the package I'm using is: https://www.npmjs.com/package/pdfjs-dist ) the visual fails to compile, giving me the following error:

 

 

ERROR in ./node_modules/pdfjs-dist/build/pdf.js 4248:26
Module parse failed: Private field '#docStats' must be declared in an enclosing class (4248:26)
File was processed with these loaders:
* ../../../../AppData/Roaming/npm/node_modules/powerbi-visuals-tools/node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.

 

 

From what I'm reading online, this problem can be solved by correctly configuring webpack in some way, but I'm a bit out of my depth here and don't know where to start tinkering. Does anyone have any tips on how to fix this issue?

0 REPLIES 0

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors