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

Only get blank buffer after run eaf-open-browser #722

Closed
colawithsauce opened this issue Jul 22, 2021 · 5 comments
Closed

Only get blank buffer after run eaf-open-browser #722

colawithsauce opened this issue Jul 22, 2021 · 5 comments

Comments

@colawithsauce
Copy link

  • Please check the *eaf* buffer, if there is any error shown in the *eaf* buffer, paste it here.
Qt: Session management error: Could not open network socket
EAF process starting...
Traceback (most recent call last):
  File "/home/colawithsauce/.emacs.d/.local/straight/repos/emacs-application-framework/core/utils.py", line 60, in on_signal_received
    self._func(obj, *args, **kwargs)
  File "/home/colawithsauce/.emacs.d/.local/straight/build-28.0.50/eaf/eaf.py", line 159, in new_buffer
    self.create_app(buffer_id, str(url), "app.{0}.buffer".format(str(app_name)), str(arguments))
  File "/home/colawithsauce/.emacs.d/.local/straight/build-28.0.50/eaf/eaf.py", line 206, in create_app
    self.create_buffer(buffer_id, url, module_path, arguments)
  File "/home/colawithsauce/.emacs.d/.local/straight/build-28.0.50/eaf/eaf.py", line 220, in create_buffer
    app_buffer = module.AppBuffer(buffer_id, url, eaf_config_dir, arguments, self.emacs_var_dict, module_path)
  File "/home/colawithsauce/.emacs.d/.local/straight/repos/emacs-application-framework/app/browser/buffer.py", line 36, in __init__
    BrowserBuffer.__init__(self, buffer_id, url, config_dir, arguments, emacs_var_dict, module_path, False)
  File "/home/colawithsauce/.emacs.d/.local/straight/repos/emacs-application-framework/core/webengine.py", line 613, in __init__
    self.add_widget(BrowserView(buffer_id, config_dir))
  File "/home/colawithsauce/.emacs.d/.local/straight/repos/emacs-application-framework/core/webengine.py", line 72, in __init__
    self.dark_mode_js = open(os.path.join(os.path.dirname(os.path.dirname(__file__)),
FileNotFoundError: [Errno 2] No such file or directory: '/home/colawithsauce/.emacs.d/.local/straight/repos/emacs-application-framework/node_modules/darkreader/darkreader.js'

Describe the bug
As the title, after calling eaf-open-browser, only get a blank buffer. It also happens after I call eaf-open-vue-demo and eaf-open-terminal.

To Reproduce

  • type M-x eaf-open-browser www.google.com , eaf-open-terminal or eaf-open-vue-demo

Versions (please complete the following info):

  • Distro and DE/WM: Archlinux Gnome40 wayland
  • Versions of Dependencies:
    $ node --version
    v16.5.0
    $ npm --version
    7.18.0
    $ pip --version
    pip 20.3.4 from /usr/lib/python3.9/site-packages/pip (python 3.9)
    $ /usr/bin/emacs --version
    GNU Emacs 28.0.50
    Copyright (C) 2021 Free Software Foundation, Inc.
    GNU Emacs comes with ABSOLUTELY NO WARRANTY.
    You may redistribute copies of GNU Emacs
    under the terms of the GNU General Public License.
    For more information about these matters, see the file named COPYING.
    

Screenshots
image

@colawithsauce
Copy link
Author

Actually, it's the issue of doom-emacs. npm_modules was installed in build-{emacs-version} directory, but when calling eaf-open-browser, the program will find these modules in repo directory.

Running ./install-eaf.sh in the "repo" directory fixed this problem.

@AloisJanicek
Copy link
Contributor

If someone runs into this issue now when eaf-apps are separated and you don't want to use the recommended eaf-install or install-eaf.py, use the following recipe in your packages.el:

(package! eaf-browser
  :recipe (:host github
           :repo "emacs-eaf/eaf-browser"
           :files ("*")
           :pre-build ("npm" "install")))

which will ensure that node dependencies are installed in repo directory and linked into build directory.

@MatthewZMD
Copy link
Member

MatthewZMD commented Aug 19, 2021

you don't want to use the recommended eaf-install or install-eaf.py

@AloisJanicek install-eaf.py ensures apps are up-to-date and the dependencies are installed, it is very important to run this because the dependencies are sometimes more than a simple npm install, all the specifications have been laid out in each corresponding dependencies.json in the app directory, which install-eaf.py follows carefully.

Try changing pre-build command to ./install-eaf.py --install-app browser --ignore-sys-deps, this installs browser only, but ignores the system dependencies which shouldn't prompt sudo (that gives this error).

Then run the install-eaf.py again in a terminal, which will install the system dependencies for you.

@AloisJanicek
Copy link
Contributor

@MatthewZMD Thank you for the recommendation and explanation.

I thought about the OP issue again and I think that eaf-browser should not block-fail when the 3rd party scripts such as dark mode or reader-mode which aren't essential for regular browsing experience aren't installed. The issue should be noted in *eaf* buffer or via emacs' user error but user should be able to browse web normally without those scripts.

But then again, if user will follow the README, it should never run into this issue in the first place. So maybe adjusting the eaf code to this scenario would just introduce unnecessary complexity.

@MatthewZMD
Copy link
Member

@MatthewZMD Thank you for the recommendation and explanation.

Did you happen to get a working installation recipe now? If so, could you please share it?

I thought about the OP issue again and I think that eaf-browser should not block-fail when the 3rd party scripts such as dark mode or reader-mode which aren't essential for regular browsing experience aren't installed. The issue should be noted in *eaf* buffer or via emacs' user error but user should be able to browse web normally without those scripts.

But then again, if user will follow the README, it should never run into this issue in the first place. So maybe adjusting the eaf code to this scenario would just introduce unnecessary complexity.

Unfortunately, some EAF codebase required the files existing at the moment. It shouldn't be terribly difficult to make it optional, but still a lot of work I personally rather not do, as you said. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants