Skip to main content
Inspiring
March 16, 2024
Question

My Coldfusion application is blank, I don't see any errors in console

  • March 16, 2024
  • 3 replies
  • 1161 views

Please find below  is home.cfm, I don't have experience in Vue framework. This application was working earlier however for the past few days I only see balnk screen but there no errors in console. I use Edge browser and Chrome browser. In both the browsers the I see only balnk screen. Please help in this regard. Thanks.

 

<div id="app" style="display:none">
<!--- start vuetify --->
<v-app> <!-- to use Vuetify components and styles, the page needs to be wrapped in v-app -->

<cfloop array="#components#" index="component">
<!--- each component file contains the vuetify markup --->
<CFINCLUDE template="ui_components/#component#.cfm">
</cfloop>


<v-main v-if="isLoaded">
<v-container >


<div class="text-h5 my-4">My System</div>

<v-card>
<v-card-text class="subtitle-1 font-weight-medium">
<v-row>
<v-col cols="7" class="pr-4">
<div class="title mb-4">Welcome</div>
<div style="line-height: 30px;">
<p>Hello {{firstname}}, welcome to the My site.</p>
<div class="home" v-html="homeHTML"></div>
</div>
</v-col>
</v-row>

</v-card-text>

</v-card>
</v-container>
</v-main>

 


</v-app>

<!--- end vuetify content --->
</div>


<script>
var vm;
document.addEventListener('DOMContentLoaded', function() {
vm = new Vue({
el: "#app",
vuetify: new Vuetify(<CFINCLUDE template="theme.cfm">),
data: function(){
return {
<cfloop array="#components#" index="component">
<!--- create data properties for the global components --->
<CFINCLUDE template="js_components/#component#.cfm">
</cfloop>

activeTab: 0,
hasUnsavedChanges: false,

isLoaded: false,
<CFOUTPUT>
firstname: "#Session.det_pref_nm#",
surname: "#Session.det_surname#",
homeHTML: "",
</CFOUTPUT>
}
},
created: function(){
this.loadAPIData();

},

methods: {
loadAPIData: function(){
var self = this;

axios.get(window.servername + "/api/home/getMyContent_json.cfm?uid="+Math.random(),{withCredentials:true})
.then(function(response){
let HTML = response.data;
HTML = HTML.replace(/<font[^>]+>/g,"").replace("</font>","");
HTML = HTML.replace('cellspacing="1"',"");
self.homeHTML = HTML;
self.isLoaded = true;

})
.catch(function(responses){
console.log("Load Error", responses);
});

},



},

 


}); // end vue

<!--- Access vue data variables in Chrome Console using vm.$data --->


document.getElementById("app").style.display = "block"; // don't show the content until it has finished rendering

}); // end DOM Content Loaded event

</script>

    This topic has been closed for replies.

    3 replies

    BKBK
    Community Expert
    Community Expert
    March 20, 2024

    When I see code similar to the following, I already expect problems:

    <script>
    ...
    <cfloop array="#components#" index="component">
    <!--- create data properties for the global components --->
    <CFINCLUDE template="js_components/#component#.cfm">
    </cfloop>
    ...
    <CFOUTPUT>
    firstname: "#Session.det_pref_nm#",
    surname: "#Session.det_surname#",
    homeHTML: "",
    </CFOUTPUT>
    ...
    </script>

    The reason I expect problems is that server-side code (CFML) is included within client-side code (Javascript). That is in general bad-practice. You should separate CFML code from Javascript.

    Inspiring
    March 19, 2024

    Hello @Vishnu22410012h6s8 ,

     

    Are you able to find any solution.

    Even I am facing same issue after I migrated to CF2021 recently. Currently we are running on CF2021 update 5, don't want to upgrade to latest version until we stabilize our application on currently installed version.

    Can I check with you which CF version you are using?

    Please let me know if you have any findings.

    Thanks,
    Dhanshree Joshi

    Charlie Arehart
    Community Expert
    Community Expert
    March 19, 2024

    dhanshreej, while you await any answer from Vishnu, can you offer an answer to the same questions I'd asked him? There's not some feature change in cf2021 that "causes blank pages". Whatever is amiss for you two will have a cause and explanation. And it will have a resolution--but we can't propose it without first knowing the cause.

     

    And as I proposed above, you can use various debugging techniques to provide us the info needed to gather more diagnostics. 

    /Charlie (troubleshooter, carehart. org)
    Inspiring
    March 19, 2024

    Hello @Charlie Arehart ,

     

    Unfortunately, in my case issue is only reproducible on production (client facing) environment. So, i cannot debug/dump values on pages.

    But we encountered this issue after we migrate only. Since last 20 years of application, no user reported this.

    Hence, we are suspecting the CF migration as cause.

    Also, not all users facing this issue. We tried clearing cache/different browsers/devices, but no luck.

     

    Thanks,

    Dhanshree J

    Charlie Arehart
    Community Expert
    Community Expert
    March 16, 2024

    Take vue (and all your page content) out the equation, and make sure first whether ANYTHING you do on this page appears. Put this at the top of the page:

     

    <cfoutput>#now()#</cfoutput> 
    <cfabort>

     

    Save the file and refresh it. Do you now see the date/time (as shown by that now() function)?

     

    If you do not, then the problem is not what you're doing in this page. It could be any number of other things, in that case. First, do the same in your application.cfm or application.cfc. Do you see it then?

     

    If still not, let us know and we can discuss still other things to consider.

     

    And of course, remove these changes immediately. You don't want them aborting requests once we may resolve whatever is another problem. 

    /Charlie (troubleshooter, carehart. org)
    Inspiring
    March 16, 2024

    Hi @Charlie Arehart , thanks for your reply. I see the date/time in the home.cfm

    Charlie Arehart
    Community Expert
    Community Expert
    March 16, 2024

    Ok. First, if you remove that code, do you still get a blank? You might not, for reasons I won't bother to elaborate now.

     

    If it's still blank, the next question would be to have you view what your "blank" page shows as its underlying html. Do you know how to have your browser show you that? (If not, what browser are you using?)  Does that underlying html source show "nothing", or do you see there mostly what you had in the cfm page?

     

    And are you familiar with your browser's dev tools feature, in case we'd skip to using that to try to diagnose things?

     

    Finally, what's your level of cfml and/or html coding skill? Do you do  it daily, or rarely? Sometimes we get site owners who are just trying to tweak their page that was built by someone else. Knowing your experience can influence how we explain helping you solve things. 

    /Charlie (troubleshooter, carehart. org)