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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
coriben
Helper I
Helper I

PowerBI Embedded report hangs on loading when rendered by Javascript API

Hello, I'm trying to embed a PowerBI report into my web app, that is running locally in my dev server, with the Javascript API. I know everything is working since I succesfully rendered the desired report in their Playground, so it can't be a problem with the Embedded Server or Azure. In my console window there are multiple warnings and errors of external resources blocked by the same origin policy, and an `uncaught exception: [object Object]` error probably related to the PBI Javascript API that i can't decipher. The report just loads forever, displaying the animated PowerBI logo. Is anybody else experiencing this issue while trying to embed a report locally? Here's the code responsible for rendering:

    var embedContainer = $("#container");
    var models = window.['powerbi-client'].models;

        var config= {
            type: 'report',
            tokenType: models.TokenType.Embed,
            accessToken: ginormous embed token,
            embedUrl: https://app.powerbi.com/reportEmbed?reportId=ommited_for_privacy&groupId=ommited_for_privacy,
            id: the_report_id,
            permissions: models.Permissions.All,
            settings: {
                    filterPaneEnabled: true,
                    navContentPaneEnabled: true
            }
        };

        // Embed the report and display it within the div container.
        var report = powerbi.embed(embedContainer.get(0), config);



Here are all the console errors:

 

    uncaught exception: [object Object]

    Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://dc.services.visualstudio.com/v2/track. (Reason: CORS request did not succeed).

    Source map error: request failed with status 404
    Resource URL: http://localhost:3000/temp/scripts/App.js

    Source Map URL: powerbi.js.map
    Source map error: request failed with status 404
    Resource URL: https://app.powerbi.com/13.0.5314.162/scripts/ai.0.js

    Source Map URL: ai.0.js.map
    Source map error: request failed with status 404
    Resource URL: https://app.powerbi.com/13.0.5314.162/scripts/reportembed.externals.bundle.min.js

    Source Map URL: interact.min.js.map

  Thanks!

1 ACCEPTED SOLUTION

Hello, I don't know what that is but I got it to work. I was able to see the exception text in Chrome's console (I use Firefox) and it turned out to be a typo in the tokenType parameter. Thanks anyway!

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @coriben,

 

do you use Application insights? There is a Cors issue there ar your code. You may want to give a look here https://docs.microsoft.com/en-us/azure/application-insights/app-insights-separate-resources or temporarily

remove it.

 

Hope it helps.

 

Regards,

 

Thanos

Hello, I don't know what that is but I got it to work. I was able to see the exception text in Chrome's console (I use Firefox) and it turned out to be a typo in the tokenType parameter. Thanks anyway!

coriben
Helper I
Helper I

I'm trying to embed a PowerBI report into my web app, that is running locally in my dev server, with the Javascript API. I know everything is working since I succesfully rendered the desired report in the Playground, so it can't be a problem with the Embedded Server or Azure. In my console window there are multiple warnings and errors of external resources blocked by the same origin policy, and an uncaught exception: [object Object] error probably related to the PBI Javascript API that i can't decipher. The report just loads forever, displaying the animated PowerBI logo. Is anybody else experiencing this issue while trying to embed a report locally? Here's the code responsible for rendering:

 

    var embedContainer = $("#container");
    var models = window.['powerbi-client'].models;

        var config= {
            type: 'report',
            tokenType: models.TokenType.Embed,
            accessToken: ginormous embed token,
            embedUrl: https://app.powerbi.com/reportEmbed?reportId=ommited_for_privacy&groupId=ommited_for_privacy,
            id: the_report_id,
            permissions: models.Permissions.All,
            settings: {
                    filterPaneEnabled: true,
                    navContentPaneEnabled: true
            }
        };

        // Embed the report and display it within the div container.
        var report = powerbi.embed(embedContainer.get(0), config);


Here are all the console errors:

    uncaught exception: [object Object]

    Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://dc.services.visualstudio.com/v2/track. (Reason: CORS request did not succeed).

    Source map error: request failed with status 404
    Resource URL: http://localhost:3000/temp/scripts/App.js

    Source Map URL: powerbi.js.map
    Source map error: request failed with status 404
    Resource URL: https://app.powerbi.com/13.0.5314.162/scripts/ai.0.js

    Source Map URL: ai.0.js.map
    Source map error: request failed with status 404
    Resource URL: https://app.powerbi.com/13.0.5314.162/scripts/reportembed.externals.bundle.min.js

    Source Map URL: interact.min.js.map

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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