LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NXG 5.0 Bug Report - Javascript stopped working after changing .gcomp name

Solved!
Go to solution

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

CDuck_2-1598452415066.png

 

 

CDuck_0-1598452163114.png

(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

----------------------------------------------------
Studying for CLA.
LabVIEW, inherit from social media habits!
0 Kudos
Message 1 of 6
(1,457 Views)

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).


Milan
0 Kudos
Message 2 of 6
(1,418 Views)

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

----------------------------------------------------
Studying for CLA.
LabVIEW, inherit from social media habits!
0 Kudos
Message 3 of 6
(1,410 Views)
Solution
Accepted by topic author CDuck

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.


Milan
Message 4 of 6
(1,400 Views)

Could this issue be related to this one?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 5 of 6
(1,387 Views)

That was my first thought too!!

Message 6 of 6
(1,360 Views)