Hello, welcome to our forum, and thanks for contacting us with your question!
It is hard for us to determine the issue, without looking into the code. Could you please try to create the live demo, where your issue is reproduced?
Kind regards,
Thanks for providing us the tutorial you've followed!
I've checked it, and it should work fine. Could you tell me exactly when you're getting this error? The best option would be if you could reproduce this issue in an online editor as my colleague said.