I thought it should be 聊一会儿天, since the measure words should be put right after the verb, like in 吃一点儿东西，参观一次长城. But there are a lot more results of 聊天一会儿 on Google. (74,200 vs 18,100)
Can someone explain why is that?
My Google search gave similar results (with quotes):
"聊天一会儿" (72,500 results)
"聊一会儿天" (14,600 results)
You are right that the 1st phrase is not correct. But let's take a closer look at some results:
See, by putting a comma or rearranging the words, they now have the correct syntax. Since these are more frequently used than
聊一会儿天 (at least in writing), Google found more articles, which makes sense.
To be honest, most of the chinese in the world are come from china. If you want to learn the original chinese, then 聊一会儿天 should be the correct one.
聊天一会儿 sounds weird because 聊 is the verb, 天 just a word which "supports" the verb。So instead we add 一会儿 right after 聊, not after the "support word"
聊天一会儿 is the correct one.
聊一会儿天 is the incorrect one.
The better ways to say it will be 聊聊，谈心，聊一下，说八卦。Don't use 儿 because it also means son, and because 儿 (er) is merely an accent for some part of China. it doesn't add any meaning to your sentence.