Vuejs+elementui development front end, nginx configuration after build running site error Unexpected token <

works well in the development environment, and build is successful. Use nginx to configure the site, visit the site Times error:
Uncaught SyntaxError: Unexpected token <
page blank.

but check the nginx error log, and there are no error messages. It should not be a nginx configuration problem. I would like to ask the Great God, have you encountered any related problems?

Aug.15,2021


webpack
https://www.jianshu.com/p/6c3c33c43509

buildindex.js
    assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',// ./ /  

assetsPublicPath: '/myFile/'

is using History mode?
if so, Nginx needs to be configured
location / {
try_files $uri $uri/ / index.html;
}

.
Menu