‘Failed to compile.’ error when deploying react app to gh-pages

I’m getting this error when I try to deploy my react app to github pages:

Failed to compile.
The target environment doesn't support dynamic import() syntax so it's not possible to use external type 'module' within a script

I tried to deploy another very simple react app (the default one) to github and faced no error and was deployed easily. But somehow, when I try to deploy this app, it doesn’t work and shows the error that I mentioned earlier (The target environment doesn't support dynamic import() syntax so it's not possible to use external type 'module' within a script)

Can anyone help?

Here’s my github repo that I’m trying to deploy: https://github.com/Muhammad-Abdullah-Zeeshan/todo-list-react