[Solved] Uncaught SyntaxError: Unexpected token ‘<‘

This error is sometimes reported in front-end deployment, as shown in the following figure:


it is generally caused by improper configuration. Modify the vue.config.js file

// If the application is deployed on a subpath, you will need to specify this subpath with this option. For example, if your application is deployed at https://www.baidu.vip/admin/, set the baseUrl to /admin/.

publicPath: process.env.NODE_ENV === 'production' ?'/' : '/admin/',


Read More: