It was working fine earlier. I just used the command ./nodebb upgrade and now the 'widgets' link shows this:
Oops! Looks like something went wrong!
Update: It was the custom wigets plugin causing the error.