python-eel / Eel

A little Python library for making simple Electron-like HTML/JS GUI apps
MIT License
6.38k stars 583 forks source link

React Demo not working #575

Open elibroftw opened 2 years ago

elibroftw commented 2 years ago

Eel version Latest

Describe the bug A clear and concise description of what the bug is.

PS C:\Users\maste\Documents\GitHub\r2-t2> python .\eel.py Traceback (most recent call last): File "C:\Users\maste\Documents\GitHub\r2-t2\eel.py", line 8, in import eel File "C:\Users\maste\Documents\GitHub\r2-t2\eel.py", line 14, in @eel.expose # Expose function to JavaScript AttributeError: partially initialized module 'eel' has no attribute 'expose' (most likely due to a circular import)

To Reproduce Steps to reproduce the behavior:

  1. pip install eel
  2. Download https://github.com/ChrisKnott/Eel/blob/master/examples/07%20-%20CreateReactApp/eel_CRA.py
  3. Run it (optionally have React files)
  4. See error

Expected behavior It should work

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

piccinnigius commented 2 years ago

Hi @elibroftw! i've fixed it by including:

<!-- Load eel.js from the port specified in the eel.start options -->
  <script type="text/javascript" src="http://localhost:<your_python_host_port>/eel.js"></script>

in head of your public/index.html file.

Hope it helps!