The error message suggests that you are in fact not executing the script using bash.
Either make the script executable and add a proper #!-line on the first line of the script, e.g.
#!/bin/bash
Or, execute the script with bash explicitly:
$ bash script.sh
You should treat sh and bash as implementing separate languages, and use the correct interpreter for the script you're writing. In this case, you're using read with the -u option. This is originally a ksh extension to the standard read specification, and it's also implemented in bash and zsh. Hence, you need to run the script with bash, zsh or ksh.
How to know when to use sh and when to use bash or some other shell? It's simple, you learn the way sh works and what other features other shells add.