microsoft / data-formulator

🪄 Create rich visualizations with AI
https://arxiv.org/abs/2408.16119
MIT License
1.35k stars 73 forks source link

Why the page is blank ? #47

Closed freemank1224 closed 2 weeks ago

freemank1224 commented 3 weeks ago

After successfully installed dependencies, I run the data_formulator, it prompts a new browser window but nothing displayed on the screen. The info on command window is : ` * Serving Flask app 'data_formulator.app'

Chenglong-MS commented 2 weeks ago

Interesting! I don't expect this to happen.

Normally the status code should be:

127.0.0.1 - - [01/Nov/2024 10:03:48] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [01/Nov/2024 10:03:48] "GET /assets/index-XIyIzJet.css HTTP/1.1" 200 -
127.0.0.1 - - [01/Nov/2024 10:03:48] "GET /DataFormulator.js HTTP/1.1" 200 -
127.0.0.1 - - [01/Nov/2024 10:03:48] "GET /favicon.ico HTTP/1.1" 200 -

We can try: (1) clear the browser cache and retry http://127.0.0.1:5000/ (or maybe open it in a different browser) (2) you can also take a screenshot of the "inspect" result from the webpage (right click on the blank webpage, and in the context menu click "console" tab once the developer tool opoens), I'm curious what's the error message there. (3) if that's still an issue, you could try CodeSpaces (https://codespaces.new/microsoft/data-formulator?quickstart=1) as well!

Image

nicho2 commented 2 weeks ago

Hello, I have the same thing with this error in the console:

DataFormulator.js:1 Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.

danmarshall commented 2 weeks ago

@freemank1224 @nicho2 can you try adding this line to your app.py and see if it fixes the issue?

import mimetypes
mimetypes.add_type('application/javascript', '.js')
Chenglong-MS commented 2 weeks ago

This is the artifact from Dan's build:

You can check if this build fixes the issue by:

  1. download the tar.gz
  2. install it with 'pip install --upgrade --force-reinstall data_formulator-0.1.3.3.tar.gz'
  3. then run data_formulator

If this build looks good, we can merge Dan's PR (https://github.com/microsoft/data-formulator/pull/48)

data_formulator-0.1.3.3.tar.gz

freemank1224 commented 2 weeks ago

@freemank1224 @nicho2 can you try adding this line to your app.py and see if it fixes the issue?

import mimetypes mimetypes.add_type('application/javascript', '.js')

Thanks for this but nothing happened

freemank1224 commented 2 weeks ago

This is the artifact from Dan's build:

You can check if this build fixes the issue by:

  1. download the tar.gz
  2. install it with 'pip install --upgrade --force-reinstall data_formulator-0.1.3.3.tar.gz'
  3. then run data_formulator

If this build looks good, we can merge Dan's PR (#48)

data_formulator-0.1.3.3.tar.gz

This really NICE! It works after I followed this instructions