<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Uncaught ReferenceError: pbi is not defined in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Uncaught-ReferenceError-pbi-is-not-defined/m-p/308421#M9087</link>
    <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/47581"&gt;@stevensi1018&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;I don't know about Typescript or Angular, however per my research, that error "&lt;SPAN&gt;Uncaught ReferenceError: pbi&amp;nbsp;is not defined" is&amp;nbsp;a common issue, which indicates the powerbi-client may not be correctly referenced in this case. As to the solution, you can the &lt;A href="https://www.google.com.sg/search?biw=1784&amp;amp;bih=1014&amp;amp;ei=cBcVWqajFMyc0gTwuYKIDw&amp;amp;q=typescript+++is+not+defined&amp;amp;oq=typescript+++is+not+defined&amp;amp;gs_l=psy-ab.12...0.0.0.14869.0.0.0.0.0.0.0.0..0.0....0...1c..64.psy-ab..0.0.0....0.BafXNZadyaE" target="_self"&gt;common solutions&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/5730"&gt;@MawashiKid&lt;/a&gt;&amp;nbsp;may have more constructive advice.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Nov 2017 06:25:06 GMT</pubDate>
    <dc:creator>Eric_Zhang</dc:creator>
    <dc:date>2017-11-22T06:25:06Z</dc:date>
    <item>
      <title>Uncaught ReferenceError: pbi is not defined</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Uncaught-ReferenceError-pbi-is-not-defined/m-p/307876#M9066</link>
      <description>&lt;P&gt;I'm trying to put my report on my web application but I keep getting multiple errors. I found the following code online. I already have my accessToken in another variable in my web page but everytime I use an embededURL (&lt;A href="https://embedded.powerbi.com/appTokenReportEmbed?reportId=02e45bd6-89fe-4ce6-8240-67ec73b178fc" target="_blank"&gt;https://embedded.powerbi.com/appTokenReportEmbed?reportId=02e45bd6-89fe-4ce6-8240-67ec73b178fc&lt;/A&gt; in this case) I get the following error: "Uncaught ReferenceError: pbi is not defined". Is there something I forgot to include?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to keep this as simple as possible. I want to execute this code in my web page in javascript&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This line:&amp;nbsp;let powerbi = new pbi.service.Service(pbi.factories.hpmFactory, pbi.factories.wpmpFactory, pbi.factories.routerFactory); was not there before but I added this due to forum posts. If i remove it, the error would be "powerbi is not defined"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;var el = document.getElementById("bEmbedReportAction");
    if (el.addEventListener) {
        el.addEventListener("click", updateEmbedReport, false);
    } else {
        el.attachEvent('onclick', updateEmbedReport);
    }

    // handle server side post backs, optimize for reload scenarios
    // show embedded report if all fields were filled in.
    /*var accessTokenElement = document.getElementById('MainContent_accessTokenTextbox');
    if (accessTokenElement !== null) {
        var accessToken = accessTokenElement.value;
        if (accessToken !== "")
            updateEmbedReport();
    }*/
// update embed report
function updateEmbedReport() {

    // check if the embed url was selected
    var embedUrl = document.getElementById('tb_EmbedURL').value;
    alert(embedUrl);
    if (embedUrl === "")
        return;

    // Embed configuration used to describe the what and how to embed.
    // This object is used when calling powerbi.embed.
    // You can find more information at https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details.
    var config = {
        type: 'report',
        accessToken: accessToken,
        embedUrl: embedUrl
    };

    // Grab the reference to the div HTML element that will host the report.
    var reportContainer = document.getElementById('reportContainer');

    // Embed the report and display it within the div container.
    let powerbi = new pbi.service.Service(pbi.factories.hpmFactory, pbi.factories.wpmpFactory, pbi.factories.routerFactory);
    var report = powerbi.embed(reportContainer, config);

    // report.on will add an event handler which prints to Log window.
    report.on("error", function (event) {
        var logView = document.getElementById('logView');
        logView.innerHTML = logView.innerHTML + "Error&amp;lt;br/&amp;gt;";
        logView.innerHTML = logView.innerHTML + JSON.stringify(event.detail, null, "  ") + "&amp;lt;br/&amp;gt;";
        logView.innerHTML = logView.innerHTML + "---------&amp;lt;br/&amp;gt;";
    });&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone helps me with this ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 13:51:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Uncaught-ReferenceError-pbi-is-not-defined/m-p/307876#M9066</guid>
      <dc:creator>stevensi1018</dc:creator>
      <dc:date>2017-11-21T13:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: Uncaught ReferenceError: pbi is not defined</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Uncaught-ReferenceError-pbi-is-not-defined/m-p/308421#M9087</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/47581"&gt;@stevensi1018&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;I don't know about Typescript or Angular, however per my research, that error "&lt;SPAN&gt;Uncaught ReferenceError: pbi&amp;nbsp;is not defined" is&amp;nbsp;a common issue, which indicates the powerbi-client may not be correctly referenced in this case. As to the solution, you can the &lt;A href="https://www.google.com.sg/search?biw=1784&amp;amp;bih=1014&amp;amp;ei=cBcVWqajFMyc0gTwuYKIDw&amp;amp;q=typescript+++is+not+defined&amp;amp;oq=typescript+++is+not+defined&amp;amp;gs_l=psy-ab.12...0.0.0.14869.0.0.0.0.0.0.0.0..0.0....0...1c..64.psy-ab..0.0.0....0.BafXNZadyaE" target="_self"&gt;common solutions&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/5730"&gt;@MawashiKid&lt;/a&gt;&amp;nbsp;may have more constructive advice.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2017 06:25:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Uncaught-ReferenceError-pbi-is-not-defined/m-p/308421#M9087</guid>
      <dc:creator>Eric_Zhang</dc:creator>
      <dc:date>2017-11-22T06:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: Uncaught ReferenceError: pbi is not defined</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Uncaught-ReferenceError-pbi-is-not-defined/m-p/309094#M9113</link>
      <description>&lt;P&gt;I fixed this by including&amp;nbsp;&amp;lt;script type="text/javascript" src="(server name)/public/assets/js/powerbi.js""&amp;gt;&amp;lt;/script&amp;gt; this in my script.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2017 19:02:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Uncaught-ReferenceError-pbi-is-not-defined/m-p/309094#M9113</guid>
      <dc:creator>stevensi1018</dc:creator>
      <dc:date>2017-11-22T19:02:17Z</dc:date>
    </item>
  </channel>
</rss>

