twilio-video.js
twilio-video.js copied to clipboard
Fails to compile with webpack: The keyword 'import' is reserved
Since this change merged our webpack build of our repo using twilio-video is failing to build with the following error, so we're unable to upgrade to 2.23.0
Error: Error: [static/js/2085.1c3eda7d.chunk.js]:The keyword 'import' is reserved (2:23360)
More context: We use ecma-version-validator-webpack-plugin to pin our outputs to ES5 and it looks like the version of dynamicImport.js in the es5 build contains an un-transpiled import()
I have a potentially related issue during Fastlane build:
[stderr] [!] Error building the application - see the log above
1014
error node_modules/twilio-video/es5/dynamicImport.js: node_modules/twilio-video/es5/dynamicImport.js:Invalid call at line 8: import(
/* webpackIgnore: true */
module).
Error: node_modules/twilio-video/es5/dynamicImport.js:Invalid call at line 8: import(
/* webpackIgnore: true */
module)
at transformJS (/Users/expo/workingdir/build/node_modules/metro-transform-worker/src/index.js:262:15)
at transformJSWithBabel (/Users/expo/workingdir/build/node_modules/metro-transform-worker/src/index.js:410:16)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Object.transform (/Users/expo/workingdir/build/node_modules/metro-transform-worker/src/index.js:571:12)
info
1015
Error: Fastlane build failed with unknown error. Please refer to the "Run fastlane" and "Xcode Logs" phases.
Fastlane errors in most cases are not printed at the end of the output, so you may not find any useful information in the last lines of output when looking for an error message.
Hi all,
Thank you for reporting this issue. I was able to reproduce this issue. I have created a ticket to investigate and resolve this (VIDEO-11220). I will be keeping this thread open and update when we get more news!
Best, Joyce
Hi folks,
There is a current workaround for this issue by updating browserify to v17. Please run the below snippet in order to update browserify.
npm install -S browserify@17
Please utilize this workaround as we continue to investigate this issue and let me know if there are still any issues!
Best, Joyce
Hi @gburt , @mikeauclair ,
While we troubleshoot the issue, can you set the ECMA version to 2020 in your validator plugin as a temporary workaround?
Hi @gburt , @mikeauclair ,
We have filed an internal ticket and are looking into it.
Hi @gburt , @mikeauclair ,
Can you run npm install twilio/twilio-video.js#2.24.1-rc1 and verify whether it fixes your build issue? We verified on our end that this works.
Hi @gburt , @mikeauclair ,
Can you run
npm install twilio/twilio-video.js#2.24.1-rc1and verify whether it fixes your build issue? We verified on our end that this works.
@manjeshbhargav that builds fine, thanks!
Hi Folks,
This issue has now been fixed on the latest version 2.24.1. I will now be closing this issue. But of course, please let us know if you're still running into any issues.
Best, Joyce