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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

WebSocketServer throwing UnhandledPromiseRejectionWarning

Hi All,

I am building  a new Custom Visual for Google maps integrated with the api key.

 

but I am getting compilation error as

 

(node:2784) UnhandledPromiseRejectionWarning: C:\Users\shashekh\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\node_modules\webpack-dev-server\lib\servers\WebsocketServer.js:10
  static heartbeatInterval = 1000;
                           ^

SyntaxError: Unexpected token =
    at new Script (vm.js:80:7)
    at createScript (vm.js:274:10)
    at Object.runInThisContext (vm.js:326:10)
    at Module._compile (internal/modules/cjs/loader.js:664:28)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
(node:2784) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:2784) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

 

My node version is : 10.15.3

 "powerbi-visuals-api": "5.1.0",

 

Thanks for helping!

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

This issue is coming up even if try to create a new visual which by default gets generated when you run the command :- pbiviz new sampleVisual

as well  it is pointing to a node  module  WebsocketServer at this line :

module.exports = class WebsocketServer extends BaseServer {
  static heartbeatInterval = 1000;

Is there any specification that I need to change in my machine for this?

Anonymous
Not applicable

HI @Anonymous,

According to the error message, it seems like an 'unexpected token' appeared in your function and you haven't set any ‘try catch’ model to catch/trace the detailed error message do these code directly exited without any results.

I'd like to suggest following the error message code lines to check them and setting if statement to exclude not match value and 'try catch' model to trace detailed error message.

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

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.