question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Describe the problem I’m trying to create an app using Vue.js as fronted with Eel. However after following some other issues here on github I’m stuck with the following error: error 'eel' is not defined no-undef

I put the Eel.js as src in my index.html file:

<script type='text/javascript' src='http://localhost:8080/eel.js'></script>

Here is main.py eel file:

import eel
import threading
import sampling
from subprocess import call
from time import sleep


def start_web():
    call(['./start.sh'])


def start_eel():
    sleep(7)
    eel.init('VueApp', allowed_extensions=['.js', '.html', '.vue'])
    eel.start('', options={
        'port': 8080,
        'host': 'localhost',
    })


if __name__ == '__main__':
    t1 = threading.Thread(target=start_web)
    t2 = threading.Thread(target=start_eel)
    t1.start()
    t2.start()

So Im running the app in dev mode, as sugested in another issue here.

Here is my start.sh file:

cd VueApp
npm run dev

The thing is I’m stuck what else I should do. Is there a place I should somehow import Eel into Vue that I’m missing? My Vue app is running on port 8686 because if I set it to run on same port I get OSError in eel, not sure if that is correct.

I think you guys managed to get this work, could you please share what should I do to make Vue recognize eel? @hiancdtrsnm @alexwohlbruck @ahopkins

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:16 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
alexwohlbruckcommented, Apr 20, 2020

The selected port doesnt matter, as long as they are the same. I try to keep it on something relatively unique in case another local server is running on that port.

Also, forgot to mention. To use the eel object in js, I just referenced window.eel and it works just fine. I cannot find any way to import it with an es6 import statement.

You can reference the code in my project.

1reaction
luciferamjicommented, Dec 6, 2020

yeah @alexwohlbruck i forgot to mention the port numberin index.html i checked . Your code really helped.

Read more comments on GitHub >

github_iconTop Results From Across the Web

smketterer/vue-eel-starter: A demo project for my talk ... - GitHub
This is a basic Vue starter project to introduce people to Eel. I have used Eel for a couple projects already, and have...
Read more >
Eel vs Vuido | What are the differences? - StackShare
Eel - A little Python library for making simple Electron-like HTML/JS GUI apps. Vuido - Native desktop applications with Vue.js.
Read more >
Making desktop app using Vue and Python - YouTube
This video will show you how to combine the power of both Vue and Python.if you want source code use this ...
Read more >
Python eel + vite - vue.js - Stack Overflow
I'm trying to build a desktop application using python's eel combined with vite's vue. I found this link to a repo that uses...
Read more >
python-eel-vue - Gitee
可以用python进行桌面端应用开发,实现了python和vue的通信,和相互的方法调用. ... 服务端口,然后将app设为None, 2、将端口和vue的public/index.html 中的eel.js绑 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found