I am trying to use jquery for dom manipulation on mount event of a component like this.
<my-tag>
<p>hi</p>
<script>
this.on('mount',funciton() {
$('.abc').hide();
})
</script>
</my-tag>
This throws an error shown below
TypeError: Cannot read property 'toString' of undefined
at ServerResponse.writeHead (_http_server.js:189:44)
If I replace
$(".abc").hide()
with
console.log("test");
This works perfectly. Any idea why this is happening?
Given below are the version details
Riot version:
riot-cli: 2.3.14 - https://github.com/riot/cli
riot-compiler: 2.3.22 - https://github.com/riot/compiler
Update
This issue happens only if if place it in this.on('mount')
I tried placing it on this.on('all') and it works fine.