Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The chart don't display in 1.22 #1446

Closed
charlieshen7 opened this issue Jul 9, 2022 · 13 comments
Closed

The chart don't display in 1.22 #1446

charlieshen7 opened this issue Jul 9, 2022 · 13 comments
Labels
bug-external platform:windows Issues related to using Fava on Windows

Comments

@charlieshen7
Copy link

charlieshen7 commented Jul 9, 2022

Everything works fine in fava1.21
but when i update fava to 1.22, the chart can't display in the webpage

And i also can't see the filter option; journal content
If i reinstall fava 1.21, everything works fine( chart, filters .etc)

should i change some option to make fava 1.22 works well?

beancount version is 2.3.4
python version is 3.9.7

@yagebu
Copy link
Member

yagebu commented Jul 12, 2022

I can't reproduce this. Have you force-reloaded the browser to ensure you don't have outdated cached frontend code running? Are there errors on the Javascript console? Does this also happen with a trivial sample file? If so, can you provide one?

@adrienbeau
Copy link

adrienbeau commented Jul 14, 2022

I came here to report the same problem. A very significant regression, the title of the issue does not reflect how much Fava is broken right now for me. No journal content, no chart, no filter...

This is using the latest (as of writing) Beancount 2.3.5+ (commit b82fc257b2e1ad07784c95e68f8df76df980d3a2) and Fava 1.22.1, with Python 3.8.10.

Most importantly perhaps, Firefox 102.0 on Ubuntu 20.04, with few extensions (KeePassXC-Browser, Plasma Integration, uBlock Origin). In particular, turning off uBlock Origin does not change anything (it was not blocking anything on localhost anyway). Force reloading does not solve the issue either.

The console is chock full of errors, starting with a very suspicious "Uncaught Error: Loading ledger data failed.", followed by many "Uncaught TypeError: val is undefined", and then a lot of 404 errors trying to GET http://localhost:5000/my-personal-beancount-file/income_statement/undefinedapi/changed.

@adrienbeau
Copy link

adrienbeau commented Jul 14, 2022

I did a quick git bisect before calling it off for the night. Actually two, because the charts and journal break in separate commits.

  • 233d30a is the first bad commit. It breaks the charts, however the journal keeps working.
  • 16cdcd4 is the first commit that breaks the journal.

@adrienbeau
Copy link

As I investigate this further, I notice I have not properly followed the build instructions, so my comments above are incorrect, because app.js was not properly regenerated.

Installing the released egg using pip install --upgrade fava gives me a version that works fine.

@yagebu
Copy link
Member

yagebu commented Jul 26, 2022

Closing, as no further info was provided

@charlieshen7
Copy link
Author

I can't reproduce this. Have you force-reloaded the browser to ensure you don't have outdated cached frontend code running? Are there errors on the Javascript console? Does this also happen with a trivial sample file? If so, can you provide one?

image
here is an error

I tried force-reloaded the browser and used the sample file, but didn't work, the chart can't show up in 1.22 still

@yagebu
Copy link
Member

yagebu commented Jul 29, 2022

Seems like the mimetype guessing on your machine is broken. Are you on Windows by any chance? Can you check whether your registry is properly configured? see pallets/flask#1045 for more details about this

@charlieshen7
Copy link
Author

Seems like the mimetype guessing on your machine is broken. Are you on Windows by any chance? Can you check whether your registry is properly configured? see pallets/flask#1045 for more details about this

Do you mean this registry? It seems nothing wrong
image

@charlieshen7 charlieshen7 reopened this Aug 1, 2022
@yagebu
Copy link
Member

yagebu commented Aug 4, 2022

What does it show for .js? The error that you showed above is for the Javascript file.

@ThomasdenH
Copy link

ThomasdenH commented Aug 11, 2022

Edit: This was fixed by uninstalling fava and reinstalling. I think I had an (old) installation both in usr/local/... as well as in a virtual environment which may have caused this issue.

I have an issue with 1.22.3 that may be related. I'm on Windows as well (although I run Fava through WSL). The issue happens independently of browser.

image
image
image

FWIW,

import mimetypes

print(mimetypes.guess_type('style.css'))

outputs ('text/css', None) as expected.

@CicadaCinema
Copy link

CicadaCinema commented Aug 28, 2022

I am also experiencing this issue:
image

Resolution

The problem was resolved after changing value of the "Content Type" registry entry visible in the screenshot above to "text/javascript" and rebooting my computer. It may be necessary to reload your browser cache to fix this issue.

Version information:

C:\Users\Atom>bean-check --version
Beancount 2.3.5

C:\Users\Atom>fava --version
fava, version 1.22.3

C:\Users\Atom>python --version
Python 3.10.1

image

Other reports of this problem

golang/go#32350
https://developercommunity.visualstudio.com/t/installer-mime-type-for-js-extension-is-set-to-tex/954263

@yagebu yagebu added platform:windows Issues related to using Fava on Windows bug-external and removed status:not-reproducible labels Sep 28, 2022
@yagebu
Copy link
Member

yagebu commented Sep 28, 2022

I'm closing this issue - this seems to be a Windows problem and not a Fava issue IMHO

@yagebu yagebu closed this as completed Sep 28, 2022
@charlieshen7
Copy link
Author

I am also experiencing this issue: image

Resolution

The problem was resolved after changing value of the "Content Type" registry entry visible in the screenshot above to "text/javascript" and rebooting my computer. It may be necessary to reload your browser cache to fix this issue.

Version information:

C:\Users\Atom>bean-check --version
Beancount 2.3.5

C:\Users\Atom>fava --version
fava, version 1.22.3

C:\Users\Atom>python --version
Python 3.10.1

image

Other reports of this problem

golang/go#32350 https://developercommunity.visualstudio.com/t/installer-mime-type-for-js-extension-is-set-to-tex/954263

thanks a lot!

m9810223 added a commit to m9810223/fava that referenced this issue Nov 6, 2023
```console
$ fava bcs/main.bc -p 5001  # <- python 3.12
Invalid mimetype set for '.js', overriding
Starting Fava on http://127.0.0.1:5001
```

- `mimetype` sometimes broken on windows: <python/cpython#97646>
- use `text/javascript`: <beancount#1446>
m9810223 added a commit to m9810223/fava that referenced this issue Nov 6, 2023
(Python 3.12) hide error message: `Invalid mimetype set for '.js', overriding`
- `mimetype` sometimes broken on windows: <python/cpython#97646>
- use `text/javascript`: <beancount#1446>
```console
$ fava bcs/main.bc -p 5001
Invalid mimetype set for '.js', overriding  # <- !
Starting Fava on http://127.0.0.1:5001
```
m9810223 added a commit to m9810223/fava that referenced this issue Nov 6, 2023
(Python 3.12) hide error message: `Invalid mimetype set for '.js', overriding`
- `mimetype` sometimes broken on windows: <beancount#1446>
- use `text/javascript`: <python/cpython#97646>
```console
$ fava bcs/main.bc -p 5001
Invalid mimetype set for '.js', overriding  # <- !
Starting Fava on http://127.0.0.1:5001
```
yagebu pushed a commit that referenced this issue Nov 11, 2023
(Python 3.12) hide error message: `Invalid mimetype set for '.js', overriding`
- `mimetype` sometimes broken on windows: <#1446>
- use `text/javascript`: <python/cpython#97646>
```console
$ fava bcs/main.bc -p 5001
Invalid mimetype set for '.js', overriding  # <- !
Starting Fava on http://127.0.0.1:5001
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-external platform:windows Issues related to using Fava on Windows
Projects
None yet
Development

No branches or pull requests

5 participants