Webview displays ' Start a server to see focused output'

Question:
I am building Tronweb and have debugged it–and it’s good(this is my first completed project). My only hiccup is when I run it I get a message in my webview window that says, ’ start server to see hosted output’. How do I fix this? My first attempt to fix it is my index.html file. Do I need to delete, keep or change this?

Repl link:

https://replit.com/@Dametria/tronweb

code snippet:

Yes and no. When I looked at your projects index.html file, I found some errors with tags and other syntax; however, I was able to get the project to run.
Here’s the corrected code if that’s the problem:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"> 
  <content= "width=device-width, initial-scale=1.0">
  <title>Tron Blockchain Data</title>
</head>
<body>
  <h1> Tron Blockchain Data</h1>
  <script src="index.js"> </script> 
</body>
  </html>

As for the output problem… the server should start after you press the run button. When you are experiencing this issue, is the run button replaced with a button that says ‘working’ or one that says ‘stop’?

Try forking this. It’s your repl with the modifications to index.html discussed above, and I’ve confirmed that it works:
https://replit.com/@sj02/tronweb?v=1#README.md
I hope this resolves your issue!

Many thanks!! And yes and no… again. My main issue is still present. My index.js isn’t displaying in webview and I honestly haven’t been able to figure out why.

Could you send a screenshot of your issue?

Hi @Dametria !
On line 11 of index.html, I see this line:

<script src>="index.js" </script> 

But before we fix that, we need to look at what your repl is doing. You are using a Node.js repl, which runs index.js for the backend. Why would you be linking it in the HTML file?
The corrected code will be:

<script src="index.js"></script> 

But I don’t see what you are going to do with it. It’s like going around in circles.
Hope this helps!

1 Like

Ok. Many thanks! And, I’d have to return yes and no. I did need to correct the html file-as having broke on top of broke will never get me there. Still, my initial issue is my output not being displayed in the web view. And to your query, when I am experiencing the issue the run button is changed to stop. Now, my console will list balance, transaction and event but just those words–no data.

It still says ‘Start Server to See Hosted Output’'?

No. It displays the 'Tron Blockchain Data’s but I can’t seem to get my index.js file to display it’s output in webview. Is there any way to execute my queries in the webview dev console? That would be fine, too.

The Console (Webview’s one and the one when you click Inspect) will only display things if you use console.log() for Static repls. If yours has a backend, I believe it will display the stuff in Replit’s Console, but you can try putting the line in the HTML file and not in the JS file.
Hope this helps!