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.

Unable to call function

See original GitHub issue

Describe the problem I am not able to call python function from Javascript, i followed guides and it works on other program but not able to achieve it for this code.

Code snippet(s) repo - https://github.com/axl3blaz3/Eel-help

@eel.expose
def start_record():
    ctypes.windll.user32.MessageBoxW(0, "ok", "Message", 1)
    eel.spawn(get_audio())

```javascript
var vClix = document.getElementById('canvas');
vClix.addEventListener('click',vRespondClick);

async function vRespondClick(){
var vText = document.getElementById('fire');

vText.innerHTML = 'Speak';
vText.style.color = '#ff3333';
vText.style.backgroundImage = 'linear-gradient('
        + 'to top' + ', ' + '#ff3333 0%' + ', ' + '#cc0000 100%' + ')';
vSpeed = 420;
vPhase = 35;
rangeMax = 10;
vClix.disabled = true;

console.log('start');	
await eel.start_record()();	
console.log('end');	
eel.expose(LisaTextract);
function LisaTextract(vLisaTexto){
	vLisaTextto();	
}

Desktop (please complete the following information):

  • OS: [Windows]
  • Browser [Chrome]
  • Version [ 80.0.3987.132]

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
RahulBadenkalcommented, Mar 10, 2020

Don’t ask why, but If you change:

<script type="text/javascript" src="/eel.js" async> </script> 
to 
<script type="text/javascript" src="/eel.js"> </script>

It all works fine. I am not sure what async does inside script tag but somehow it was affecting how eel interacts. Never seen async used in such a way though.

1reaction
axl3blaz3commented, Mar 5, 2020

I can change but for some reason it still isn’t working for me…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to call function with self - python - Stack Overflow
In your case, you call the function object on the class. As it is not a staticmethod or classmethod, it is called with...
Read more >
Why can't I call this function? - Codecademy
But I wanted to input a number to run the function - whenever I do this it just returns 'none' as if I...
Read more >
unable to call function in script - MATLAB Answers - MathWorks
Answer to self: The error was due to inserted test code at begin of file in the same script which calls that function....
Read more >
Unable to call function by a dynamically generated package ...
I am trying to call a function that has a dynamic package path. For example data.rules[input.x].match(r) Here the actual package is ...
Read more >
Unable to call function in ModuleScript - Scripting Support
I'm attempting to call a function in a ModuleScript. Currently, I'm recieving an error that I'm attempting to call a nil value.
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