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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
vincent_1234
Helper I
Helper I

Issue with external library

Dear all,

 

I'm converting my visual to the API v.1.2.0 and was happy to see "externalJS" files are now supported.

I've implemented this and I see the code of these third party files when debugging.

The strange thing is, jQuery ($) does work in my visual, however Leaflet (L) is undefined from within my code, but actually is declared (lib initialization code is invoked). Somehow PowerBI seems to clear these globals.

How do I solve this?

 

With kind regards

5 REPLIES 5
v-chuncz-msft
Community Support
Community Support

@vincent_1234,

 

Based on my test, you could add the library by using tsconfig.json file. See https://github.com/Microsoft/PowerBI-visuals/blob/master/Tutorial/ExternalLibraries.md.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I was able to use the library using window.L (and not just L)

This is strange because outside Power BI it is without the window prefix, just like the $ for jQuery

@vincent_1234,

 

How do you implement the constructor method?

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I'm not sure I understand your question.

When adding the external libs to the tsconfig, the code is initialized just before mine and are accessible through the window object

@vincent_1234,

 

Where do you use Leaflet? Could you please post the related code snippet here, as well as some screenshots?

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.