The same thing happened with this github issue.
https://github.com/tailwindlabs/tailwindcss/issues/1930
First / Last child for margin not working in the Next.js, Tailwindcss environment.
# not working
mt-4 first:mt-0
I would like to know the solution. thanks.