08-26-2020 09:34 AM
Issue - After Changing my gcomp file from "WebApp" to "RH520", my javascript/JSLI call on the block diagram stopped working. The js function downloads data to a csv. I changed "RH520" back to "WebApp" and it started working again. (Perhaps the JSLI didn't have it's association updated to the new project name?)
Environment - WebApp Queued Message Handler template NXG 5.0
Steps to reproduce:
Open WebApp Queued Message Handler template
Add JSLI and link to js file
(Javascript)
function download_csv(csv) {
console.log(csv);
var hiddenElement = document.createElement('a');
hiddenElement.href = 'data:text/csv;charset=utf-8,' + encodeURI(csv);
hiddenElement.target = '_blank';
hiddenElement.download = 'tempdata.csv';
hiddenElement.click();
}
Place the downloadcsv node on the block diagram with any string as input
Run the labview program in browser so that downloadcsv is activated
NOTE: csv downloaded succesfully
Change the .gcomp name from WebApp to RH520
Run the program in browser once again
NOTE: csv does not download
Expected: csv would still download after changing project name
Solved! Go to Solution.
08-26-2020 02:07 PM - edited 08-26-2020 02:07 PM
Hi CDuck,
Could you attach an example that reproduces the behavior? It would be helpful to include the entire project (lvproject, gcomp, .cache folder, etc).
08-26-2020 02:41 PM
Hey MilanR
Attached is the project. You'll notice that if you change the WebApp.gcomp to for example "BugApp.gcomp", you'll see that when running the program in browser; the "download" button will cause a "Dynamic: Stop Event" in the event loop. I have trouble tracking down what triggers it. I didn't notice this is what was happening when I first came across the issue.
Changing the gcomp back to "WebApp.gcomp" resolves the issue
08-26-2020 03:37 PM
Hi CDuck,
Thank you for sharing an example! I was able to reproduce the behavior and created Bug 1122047 to track it. My first impression is that it looks like you hit a case where the NXG cache is not updated when the Web Application Component is renamed. We will look into the bug more but a workaround seems to be:
1) Rename the component from WebApp.gcomp to BugApp.gcomp
2) Save all and close LabVIEW NXG
3) In the project folder remove the .cache directory
4) Re-open the project in LabVIEW NXG and run the BugApp.gcomp::Index.gviweb VI in the browser
Deleting the .cache directory is not a recommended / desired workflow so thank you for reporting the issue so we can look at it closer.
08-26-2020 07:28 PM
Could this issue be related to this one?
08-27-2020 01:09 PM
That was my first thought too!!