# Clientside callback example with .js function throws “cannot read property ‘apply’ of undefined” error

**URL:** <https://community.plotly.com/t/clientside-callback-example-with-js-function-throws-cannot-read-property-apply-of-undefined-error/44411>\
**Category:** Dash Python\
**Created:** [September 1, 2020, 11:55am UTC](https://community.plotly.com/t/clientside-callback-example-with-js-function-throws-cannot-read-property-apply-of-undefined-error/44411 "2020-09-01T11:55:10Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![florescorreia](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/florescorreia/32/12422_2.png) [@florescorreia](https://community.plotly.com/u/florescorreia)\
**Post date:** [September 19, 2020, 2:46pm UTC](https://community.plotly.com/t/clientside-callback-example-with-js-function-throws-cannot-read-property-apply-of-undefined-error/44411/6 "2020-09-19T14:46:44Z")

</div>

Thanks, I tried your solution, but still it does not work – I suspect it’s something on my localhost server (ubuntu 20.04) that I apparently don’t know how to address.  
However, the example works just fine when I embed the js code in the callback like this:

```auto
app.clientside_callback(
    """
    function(value) {
        return 'Client says:: "' + value + '"';
    }
    """,
    output = Output('output - clientside', 'children'),
    inputs = [Input('input', 'value')],
)

```

---

_[View the full topic](https://community.plotly.com/t/clientside-callback-example-with-js-function-throws-cannot-read-property-apply-of-undefined-error/44411)._
