Next.js Discord

Discord Forum

Error ts(80007) on await

Unanswered
Cape lion posted this in #help-forum
Open in Discord
Cape lionOP
I'm getting a minor error ts(80007) on my await statement.

My function is within a button component and I am handling the routing for when the user clicks the button. The weird thing is I'm using javascript not typescript. Also, I implemented my async and await properly so I'm not sure why I'm getting an error on await here.

const handleOnClick = async () => {
If (route) {
try {
await router.push(route)
}
catch {
...

1 Reply