What's the difference between `next build` and `next export`? I couldn't tell from reading your comment.
`next export` makes a folder of static resources (HTML, packages client JS code, CSS). It also forces every page (even dynamic ones) to compile down to HTML.