fava icon indicating copy to clipboard operation
fava copied to clipboard

fava not working in winpython

Open holahapi opened this issue 1 year ago • 3 comments

I'm new to beancount and Fava

I'm a beginner with beancount and Fava.

When attempting to run them in WinPython (portable Python), the server only shows a blank page. What could be causing this issue?

holahapi avatar May 12 '24 11:05 holahapi

You need to change the win's registry to do so,I did this successfully. like this https://github.com/beancount/fava/issues/1446#issuecomment-1271737802

yangyun98 avatar May 19 '24 15:05 yangyun98

Thanks for your help! I'd rather not touching the registry. I'll just wait for the problem to be fixed. Thanks again!

holahapi avatar May 22 '24 06:05 holahapi

A workaround was added for that issue in #1672, so that shouldn't be causing it. Does the browser console show any errors or other logs? Does the Fava application log any errors? Which versions did you install?

yagebu avatar May 22 '24 18:05 yagebu

the version that i use are

Python                        3.9.10
beancount                     2.3.6
fava                          1.27.3

when i run in the console, it shows

Microsoft Windows [Version 10.0.19045.3570]
(c) Microsoft Corporation. All rights reserved.

D:\folder\folder2>"B:\folder\winpython\_mainApp\WPy64-39100\python-3.9.10.amd64\Scripts\fava.exe" -p 44444 "D:\folder\beancount_accounting\simple\basic.beancount"
Starting Fava on http://127.0.0.1:44444

when i open the url, it display an whole white page, the chrome console shows:

:44444/static/app.js?mtime=1714918753: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.

holahapi avatar May 24 '24 14:05 holahapi

mhh, so that workaround does not seem to be working - can you try fixing your registry or seeing whether it works with a more up-to-date Python version.

What does the following Python script output?:

import mimetypes

print(mimetypes.guess_type('app.js'))
print(mimetypes.types_map.get(".js", ""))
mimetypes.add_type("text/javascript", ".js")
print(mimetypes.guess_type('app.js'))

yagebu avatar May 25 '24 06:05 yagebu

import mimetypes

print(mimetypes.guess_type('app.js'))
print(mimetypes.types_map.get(".js", ""))
mimetypes.add_type("text/javascript", ".js")
print(mimetypes.guess_type('app.js'))

output

('text/plain', None)
text/plain
('text/javascript', None)

After further testing, I found out that WinPython 3.9 works with Beancount and Fava in VMware Workstation.

I guess the issue was caused by having another Anaconda Python installation.

holahapi avatar May 25 '24 16:05 holahapi