emacs-eaf / emacs-application-framework

EAF, an extensible framework that revolutionizes the graphical capabilities of Emacs
GNU General Public License v3.0
3.06k stars 231 forks source link

eaf-open-terminal fails with error "js: Uncaught ReferenceError: Terminal is not defined" #310

Closed linyopt closed 4 years ago

linyopt commented 4 years ago

My platform: WSL2 Arch

It worked very well before, but it has been broken for some time and I still don't know what has happened.

The solution in this post doesn't seem to work for me.

Or referring to this post, maybe it is the problem of symlinks, but I don't know how to solve it.

Could you help me to solve this issue? I really love this tool!

Screencast

MatthewZMD commented 4 years ago

Do you have EAF_DIRECTORY/app/terminal/node_modules/xterm?

linyopt commented 4 years ago

Yes. And the version of eaf is the newest.

% la -s .emacs.d/extensions/emacs-application-framework/app/terminal/node_modules
total 32K
4.0K drwxr-xr-x 4 linying linying 4.0K Jun 17 10:21 nan
4.0K drwxr-xr-x 9 linying linying 4.0K Jun 17 10:30 node-pty
4.0K drwxr-xr-x 3 linying linying 4.0K Jun 17 10:21 ws
4.0K drwxr-xr-x 6 linying linying 4.0K Jun 17 10:21 xterm
4.0K drwxr-xr-x 6 linying linying 4.0K Jun 17 10:21 xterm-addon-attach
4.0K drwxr-xr-x 6 linying linying 4.0K Jun 17 10:21 xterm-addon-fit
4.0K drwxr-xr-x 7 linying linying 4.0K Jun 17 10:21 xterm-addon-search
4.0K drwxr-xr-x 6 linying linying 4.0K Jun 17 10:21 xterm-addon-web-links
manateelazycat commented 4 years ago

@MatthewZMD It's looks something wrong after upgrade system.

Can you help to check it? Thanks

MatthewZMD commented 4 years ago

I don't use WSL2 and cannot reproduce this error without it, don't have any clue for now.

manateelazycat commented 4 years ago

manjaro can reproduce this issue

linyopt commented 4 years ago

@manateelazycat I believe that it is some upgraded packages causing this issue since now my eaf fails to run eaf-open and eaf-open-browser as the same as eaf-open-terminal, just showing nothing with a single blank window.

The contents in *eaf* buffer are:

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-linying'
EAF process starting...
Session is not restored, as no data present in session file.
js: Deprecation notice: Use specific `@ember/*` imports instead of `ember` (deprecated since Discourse 2.4.0) (removal in Discourse 2.5.0)
js: A cookie associated with a cross-site resource at https://doubleclick.net/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.
Session is not restored, as no data about PDF_FILE_NAME.
Saved session:  app.pdf-viewer.buffer PDF_FILE_NAME 0:3.1372549019607843:fit_to_width:True

Not long ago, they ran well and smoothly.

HollowMan6 commented 4 years ago

I do have the same error here, failing to execute eaf-open-terminal, showing nothing with a single blank window, too. But I'm normal with eaf-open and eaf-open-browser. I use Manjaro, and after checking, I also believe it is some upgraded packages causing this issue and also not long ago, they ran well and smoothly on Manjaro.

I have checked the errors and I think it's not EAF's fault, it looks like it can't recognise the file:// url scheme, but I still don't know why: image

So I made a temporarily solution by moving the terminal folder to to a local apache web sever using xampp. image

Then replace %2 with http://127.0.0.1/terminal in index.html at your EAF directory. image

This will allow everything to return normal. image

I know it's a bad idea to do so, but this can give you temporarily access to EAF-terminal, and it gives you a chance to use it before the bugs in related packages being fixed

MatthewZMD commented 4 years ago

This is absurd, can you guys paste the output of installed dependencies versions?

linyopt commented 4 years ago
% yay -Sl | ag 'python-pyqt5|python-pyqt5-sip|python-pyqtwebengine|python-qrcode|python-feedparser|python-dbus|python-pyinotify|python-markdown|nodejs|aria2|libreoffice|python-pymupdf|python-grip|filebrowser-bin' | ag installed
aur python-grip-git unknown-version [Installed]
aur filebrowser-bin unknown-version [Installed]
aur python-pymupdf unknown-version [Installed]
extra libreoffice-fresh 6.4.5-1 [installed: 6.4.4-1]
extra python-dbus 1.2.16-1 [installed]
extra python-dbus-common 1.2.16-1 [installed]
extra python-feedparser 5.2.1-6 [installed]
extra python-pyqt5 5.15.0-3 [installed]
extra python-pyqt5-sip 12.8.0-1 [installed]
extra python-pyqtwebengine 5.15.0-2 [installed]
community aria2 1.35.0-2 [installed]
community nodejs 14.5.0-1 [installed: 14.4.0-1]
community python-markdown 3.1.1-4 [installed]
community python-pyinotify 0.9.6-7 [installed]
community python-qrcode 6.1-4 [installed]
archlinuxcn filebrowser-bin 2.3.0-1 [installed]
archlinuxcn python-pymupdf 1.17.2-1 [installed]
arch4edu python-grip-git 4.5.2.r564.27a4d6d-1 [installed]

Since I installed the depencies by yay following the readme introduction, I paste the output using yay.

There are 3 packages of unkown-version. Because I keep them up-to-date, I have checked in aur, the version of python-grip-git is 4.5.2, filebrowser-bin is 2.3.0-1, python-pymupdf is 1.17.2-1.

HollowMan6 commented 4 years ago
Package Name Version
python-pyqt5 5.15.0-2
python-pyqt5-sip 12.8.0-1
python-pyqtwebengine 5.15.0-2
python-qrcode 6.1-4
python-feedparser 5.2.1-6
python-dbus 1.2.16-1
python-pyinotify 0.9.6-7
python-markdown 3.1.1-4
nodejs 14.3.0-1
aria2 1.35.0-2
libreoffice-still 6.3.6-1
filebrowser-bin 2.3.0-1
python-pymupdf 1.17.2-1
python-grip 4.5.2-1
MatthewZMD commented 4 years ago

Try to downgrade python-pyqtwebengine to 5.14.0-4, not sure if it's directly related to this, but i was having issues when in upgraded to 5.15 two weeks ago.

linyopt commented 4 years ago

@MatthewZMD I think it's the issue of nodejs.

According to these two lists of packages' versions, I think it is the issue of nodejs. My version is one small version newer than @HollowMan6 's. And I have tried to downgrade it to v14.3.0, then eaf-open and eaf-open-browser works! But eaf-open-terminal still fails to work.

I'm now trying to downgrade it to a much older version to check out whether it would work or not. But the older version of nodejs doesn't seem to work in a newer version of system.


I have tried to downgrade python-pyqtwebengine to 5.14.0-4 and keep nodejs the newest version, eaf-open-browser and eaf-open works while eaf-open-terminal still fails to work.

HollowMan6 commented 4 years ago

Try to downgrade python-pyqtwebengine to 5.14.0-4, not sure if it's directly related to this, but i was having issues when in upgraded to 5.15 two weeks ago.

I have downgrade python-pyqtwebengine to 5.14.0-4, but the terminal still fails to run.

manateelazycat commented 4 years ago

I guess, after WebEngine upgrade, WebEngine is not allowed "file://path" to load in JavaScript.

We need figure out how to import local javascript file from html.

MatthewZMD commented 4 years ago

I finally encountered this same error after an upgrade