Search code examples
vuejs3stagingzegocloud

Illegal 'use strict' directive in function with non-simple parameter list


Illegal 'use strict' directive in function with non-simple parameter list

See Image of the Error

Uncaught SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list at ./node_modules/.pnpm/[email protected]/node_modules/localforage/dist/localforage.js (index.bb2c0682.js:25076:304) at webpack_require (index.bb2c0682.js:81285:298) at eval (ZegoExpressWebRTM.js:1:164) at eval (ZegoExpressWebRTM.js:1:311) at ./node_modules/.pnpm/[email protected]/node_modules/zego-express-engine-webrtm/ZegoExpressWebRTM.js (index.bb2c0682.js:80907:350) at webpack_require (index.bb2c0682.js:81285:298) at eval (ZegoExpressWebRTC.js:1:41) at eval (ZegoExpressWebRTC.js:1:234) at ./node_modules/.pnpm/[email protected]/node_modules/zego-express-engine-webrtc/ZegoExpressWebRTC.js (index.bb2c0682.js:80898:299) at webpack_require (index.bb2c0682.js:81285:298)

This error appears on the staging environment of my vue js app that uses ZegoCloud Prebuilt UIKit

My steps for deploying:

npm run build on my local development branch

commit and push on the development branch

git pull on my server

Info about server setup: EC2 Instance - Ubuntu

The error appears only on the staging environment but not on the local development. If anyone can help, thank you!


Solution

  • I was able to solve my issue in my staging environment.

    I encountered errors when running the ZegoCloud package version 1.8.2 in my staging environment, and the reason behind these errors remains unknown. If anyone has insights or potential solutions for this issue, please kindly share them as an answer below.

    To resolve the problem, I successfully downgraded the zegocloud prebuilt package from version 1.8.2 to 1.5.2. It appears that the package version 1.8.2 experiences problems related to the "use strict" directives.

    Here are the steps I followed to perform the downgrade:

    Edit the package.json file:

    Change the line:

    from: "@zegocloud/zego-uikit-prebuilt": "^1.8.2"
    to: "@zegocloud/zego-uikit-prebuilt": "1.5.2"


    Run the command:
    npm run build

    Commit and push the changes.

    Pull the updated code from the server.

    Note: I have not tested the Zegocloud package versions between 1.5.2 and 1.8.2, so it is possible that alternative versions within that range may also resolve the issue.