positron icon indicating copy to clipboard operation
positron copied to clipboard

Some Dash apps don't display in viewer

Open testlabauto opened this issue 1 year ago • 4 comments

System details:

Positron and OS details:

OSX 2024.10.0-5

Interpreter details:

Python 3.10.12

Describe the issue:

Trying to get a dash app displayed in the viewer with my system configuration. Using: this app

Steps to reproduce the issue:

  1. On a system using ohmyzsh
  2. Try and run the app.py specified above using the play icon above the file in Positron
  3. Note that the app will run and be visible in a browser but not in the viewer

Expected or desired behavior:

Dash app in Viewer; worst case scenario: a warning that this will not work. I am able to see a warning in dev mode but not in release.

Were there any error messages in the UI, Output panel, or Developer Tools console?

Uncaught SyntaxError: Identifier 'hostMessaging' has already been declared

testlabauto avatar Oct 03 '24 21:10 testlabauto

Note that I have turned off an on the setting terminal.integrated.shellIntegration.enabled and retested and have tried a few workarounds to no avail.

testlabauto avatar Oct 03 '24 21:10 testlabauto

I tried on window 11 with 2024.10.0-13 and I also do not see the app in the viewer after hitting the "play" button.

I have to click the URL, then I get the dialog asking where I'd like to open the URL, and there I can pick viewer. But it does not open up automatically after hitting the "play" button

Image

jonvanausdeln avatar Oct 03 '24 22:10 jonvanausdeln

I'm using Mac with 2024.10.0-13 and echo exactly what @testlabauto & @jonvanausdeln stated. Must use "Open in ..." to be able to view the app.

midleman avatar Oct 04 '24 14:10 midleman

Note that the very simple example:

from dash import Dash, html
app = Dash()
app.layout = [html.Div(children='Hello World')]
if __name__ == '__main__':
    app.run(debug=True)

does display in my viewer, however the more complex example does not. Curiously, though, the more complex example does work for @isabelizimm.

testlabauto avatar Oct 08 '24 15:10 testlabauto

This might have been fixed in #4978 as I increased the timeout for python app startup. I've been able to run this app on Mac Desktop and in Positron on Workbench on Linux.

sharon-wang avatar Nov 05 '24 15:11 sharon-wang

I just checked with 2024.11.0-140 on both Windows 11 and Workbench on Ubuntu 24 .. and the app works as expected. 🥳

jonvanausdeln avatar Nov 05 '24 16:11 jonvanausdeln

@testlabauto can you verify MacOS?

jonvanausdeln avatar Nov 06 '24 16:11 jonvanausdeln

If anyone has an opportunity (including myself), could someone also try setting a specific port number for the Dash app?

It'd be great if we can confirm/deny which Dash app requirements are applicable when running in Positron.

I think we'd just need to change app.run(debug=True) in the example app to app.run(debug=True, port=<AN_AVAILABLE_PORT>) to test this.

sharon-wang avatar Nov 07 '24 15:11 sharon-wang

It does appear to work most of the time for me now. I do occasionally see:

Image

but then it works anyways. We have clearly made headway here so I think we are good to close this.

testlabauto avatar Nov 07 '24 15:11 testlabauto

Verified Fixed

Positron Version(s) : 2024.12.0-12
OS Version          : OSX

Test scenario(s)

Looks good most of the time. I think sometimes it fails due to it being a pretty heavy app, but we should mark this verified as we have made a lot of progress. Lets wait and see if we get any reports from outside users regarding larger Dash apps.

Specifying the port works, too.

Link(s) to TestRail test cases run or created:

testlabauto avatar Nov 07 '24 15:11 testlabauto

@testlabauto

It does appear to work most of the time for me now. I do occasionally see:

Image

but then it works anyways. We have clearly made headway here so I think we are good to close this.

Do you mind opening a separate issue for this? I think there's a bug in the run app extension around timeouts and the logic around displaying this warning (a general bug, not specific to any particular framework).

sharon-wang avatar Nov 07 '24 20:11 sharon-wang

@sharon-wang sure: https://github.com/posit-dev/positron/issues/5306

testlabauto avatar Nov 08 '24 14:11 testlabauto