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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
przemek
New Member

Custom visual - jquery and other js

Hello,

 

I need 2 js file in my custom visual

 

  1. jquery.js
  2. boostrap.js

I add to pbiviz.json like this

 

"externalJS": [
"node_modules/jquery/dist/jquery.min.js",
"node_modules/boostrap/src/boostrap.js",
],
 
i run pbiviz start and so far o good
 
but then I test in browser i have a problem like this. 
  
the whole file looks like this (i get from web console form chrome)
 

(function(powerbi) {
var window = this;

//These 2 lines are needed to trick lodash into using this as global scope
var self = this;
self.Object = Object;

//de-reference powerbi loaded modules
var $, jQuery, _;
window.jQuery = window.$ = undefined;
window._ = undefined;

/*! jQuery v3.2.1 | (c) JS Foundation and other contributors | jquery.org/license */
!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}
 
...
bla bla bla jquery min staff
....
 
/*!
* Bootstrap v3.3.7 (http://getbootstrap.com)
* Copyright 2011-2016 Twitter, Inc.
* Licensed under the MIT license
*/
if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery")
 
/*
* Power BI Visual CLI
*
* Copyright (c) Microsoft Corporation
* All rights reserved.
* MIT License
 
 
I don't know how to add external js file witch use other external file.
 
Thx for help
1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@przemek,

 

You may try to replace "jQuery" with "window.jQuery".

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.

View solution in original post

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@przemek,

 

You may try to replace "jQuery" with "window.jQuery".

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.

Thx. Is working. 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.