I got this error but had a quite silly problem. The config was fine and the build was working, but I was loading dist/index.html from two different places in my Express server. I eliminated the duplicate load, and it now works fine.
dist/index.html