Yes thanks for pointing that out, you see at the time they didn’t have a fully formed bible as we have today.
What you read in acts is quoting what John said, at that moment
read what verse 5 says
upon hearing it.
placed Matthew which Paul was speaking about.
1While Apollos was at Corinth, Paul passed through the interior
a and came to Ephesus. There he found some disciples
2and asked them, “Did you receive the Holy Spirit when you became believers?”
“No,” they answered, “we have not even heard that there is a Holy Spirit.”
3“Into what, then, were you baptized?” Paul asked.
“The baptism of John,” they replied.
4Paul explained: “John’s baptism was a baptism of repentance. He told the people to believe in the One coming after him, that is, in Jesus.”
Matthew 3:11
I indeed baptize you with water unto repentance: but he that cometh after me is mightier than I, whose shoes I am not worthy to bear: he shall baptize you with the Holy Ghost, and
with fire:
5On hearing this, they were baptized into the name of the Lord Jesus.
6And when Paul laid his hands on them, the Holy Spirit came upon them, and they spoke in tongues and prophesied.
7There were about twelve men in all.