# Help with erro MethodError

**URL:** <https://discourse.julialang.org/t/help-with-erro-methoderror/89747>\
**Category:** General Usage\
**Created:** [November 4, 2022, 12:25am UTC](https://discourse.julialang.org/t/help-with-erro-methoderror/89747 "2022-11-04T00:25:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ricardo\_Lima](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ricardo_lima/32/43312_2.png) [@Ricardo\_Lima](https://discourse.julialang.org/u/Ricardo_Lima)\
**Post date:** [November 4, 2022, 12:25am UTC](https://discourse.julialang.org/t/help-with-erro-methoderror/89747/1 "2022-11-04T00:25:48Z")

</div>

I have method to calculate the inverse of laplace.

I’m making a websocket to do the calculation and return the value.

This is the calculation that works perfectly.

```julia
using InverseLaplace
import InverseLaplace: talbot

try  
    f = eval(Meta.parse("f(s) = (8 / (8s + 1))*1/s"));
    func_invlap = Talbot(f, 2);        
    println(func_invlap);
    println(func_invlap(1));
catch e
    println(e)
end    

nothing

```

console log

```julia
Talbot{typeof(f)}(Nterms=2)
0.9345344730611376858909718271279009642943857425470905428811143880770099096286615

```

But this same calculation implemented in the websocket of the error MethodError

```julia
# ServerWS takes two functions; the first a http request handler function for page requests,

function coroutine(thisws)
    #push!(SocketList, thisws => length(WEBSOCKETS) +1 )
    #infolab = InfoLab();
    username = ""
    while true
        # This next call waits for a message to
        # appear on the socket. If there is none,
        # this task yields to other tasks.
        data, success = readguarded(thisws)
        !success && break
        #global LASTMSG = msg = String(data)
        msg = String(data)
        println("Received: $msg ")

        if startswith(msg, "tf:")
            try            
                f = eval(Meta.parse("f(s) = (8 / (8s + 1))*1/s"));
                #func_invlap = Talbot(f, 80); 
                func_invlap = InverseLaplace.Talbot(f, 2); 
                println(func_invlap);
                println("before calc")
                println(func_invlap(1));
            catch e
                println(e)
            end
            println("after calc")

        end
    end
    exitmsg = username == "" ? "unknown" : username * " has left"
    distributemsg(exitmsg, thisws)
    println(exitmsg)
    # No need to close the websocket. Just clean up external references:
    removereferences(thisws)
    nothing
end

# one for opening websockets (which javascript in the HTML page will try to do)
global LASTSERVER = WebSockets.ServerWS(req2resp, gatekeeper)

# Start the server asyncronously, and stop it later
@async WebSockets.serve(LASTSERVER, LOCALIP, HTTPPORT)

```

console log

```julia
Talbot{typeof(f)}(Nterms=5)
MethodError(f, (2.0,), 0x0000000000007ecc)

```

Can anyone tell me the cause of the error?
