-
-
Notifications
You must be signed in to change notification settings - Fork 555
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
JavaScript not executing correctly #794
Comments
pywebview does not perform any special magic when it comes to handling Javascript. I don't see any reason why it would not work, except only the case if the chosen renderer is not supported by requirejs |
I can't really put my finger on the problem right now as I can only recreate it with pywebview and no other browser. But if you say there is nothing special about pywebview in regards to javascript I will simply look for an alternative to require.js |
Could you post the entire zipped example? I can take a look at it. |
bug-demo.zip |
The official requirejs documentation addresses this issue https://requirejs.org/docs/errors.html#mismatch |
As a side note, it works on the second try after you refresh the page. |
As far as I understand the require.js documentation, this error mainly stems from the use of manually added script tags in the html document. Which I'm not doing. I'm loading all the scripts (jquery and my custom main.js) via the require.js api. For the require.js optimizer I don't really understand the documentation. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
The message to post on the issue when closing it. If none provided, will not comment when closing an issue. |
I also see the same issue with requirejs. I don't observe the error outside of pywebview, only for pywebview (on OSX). |
Specification
Description
Using pywebview with flask and the require.js library gives an error in the Browser Console and stops require.js from working correctly.
Opening the flask localhost website from any other browser (tested Chrome, Firefox, PySide webview and the native-web-app package) works fine, without any errors.
I don't fully understand how pywebview creates its windows and renders the html, but it seems somewhere along the way it has an impact on the JavaScript execution.
Example to recreate the behaviour:
/main.py
/assets/
└ jquery.js
└ require.js
└ main.js
/templates/
└ index.html
/main.py
/assets/main.js
/templates/index.html
Expected Behavior:
Observed Behavior:
Practicalities
YES I am willing to work on this issue myself.
NO I am prepared to support this issue financially.
The text was updated successfully, but these errors were encountered: