Try also npm install @ant-design/cssinjs and then re-running the build. I had the same error as you until I did that, and then it started working (but npm run dev worked fine without).
npm install @ant-design/cssinjs