Eel icon indicating copy to clipboard operation
Eel copied to clipboard

React Demo not working

Open elibroftw opened this issue 3 years ago • 1 comments

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):

  • OS: Windows 10
  • Python 3.10

Additional context Add any other context about the problem here.

elibroftw avatar Mar 14 '22 05:03 elibroftw

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!

piccinnigius avatar Mar 18 '22 13:03 piccinnigius