Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

unkown.persone's avatar

Unexpected token punc «(», expected punc «:»

Hey,

I run npm run watch It works fine, when I execute npm run production the following error shows up

Unexpected token punc «(», expected punc «:»

I don't know why. This is the file where the error comes from.

storeConversationReply (id, {body}) {
        return new Promise((resolve, reject) => {
            axios.post('/webapi/conversations/' + id + '/reply', {
                body: body
            }).then((response) => {
                resolve(response)
            })
        })
    }

I am trying to unshift a reply to the top of other replies.

appendToConversation (state, reply) {
        state.conversation.replies.data.unshift(reply);
    }

the error is: reply is undefined

I know the problem is in this code. I have got some error logs from the console as well:

if (typeof Promise !== 'undefined' && isNative(Promise)) {
    var p = Promise.resolve();
    var logError = function (err) { console.error(err); };

Pay attention that it used to work in Januaray, cause I saw a tutorial where this was done, but it doesn't work any more I assume there are some Updates

Thanks for your help :)

0 likes
2 replies
rafito's avatar

I have the same issue when I run "npm run production":

ERROR Failed to compile with 1 errors 6:11:02 PM

error

js/app.js from UglifyJs Unexpected token punc «(», expected punc «:» [./node_modules/vue-bulma-datepicker/src/BasicInput.js:9,0][js/app.js:79918,13]

Please or to participate in this conversation.