After upgrading @vue/cli-service to version ^5.0.4. the build command is not functioning normally as before. after building vue js for production, this was showing Uncaught SyntaxError: Unexpected token ':'
in the console. After checking the code, The error was coming from
const Ee = () => `http://localhost:85/${Se()}`, Se = () => Ce() && we() ? 'api' : 'v1/api',
Ce = () => 'DEVELOPMENT' === {
NODE_ENV: 'production',
VUE_APP_API_URL: 'http://localhost:85/',
VUE_APP_URL: 'http://localhost:8080/',
BASE_URL: '/'
}?.VUE_APP_ENVIRONMENT, we = () => {
NODE_ENV:'production', VUE_APP_API_URL
:
'http://localhost:85/', VUE_APP_URL
:
'http://localhost:8080/', BASE_URL
:
'/'
}
I appreciate any help.
After Better Indentation and pasting code in visual studio code. I found this
Notice the red squiggly line on lines no. 17, 18, and 19. This is happening because javascript is expecting a function body and you are returning an object.
Note: the round bracket before the curly bracket.
() => ({ ... })
instead of() => { ... }
Hope this helps