Import statement may only appear at top level in file index.android.js at 4:2

Import statement may only appear at top level in file index.android.js at 4:2
at /Users/rajatdhamija/Documents/jitsi-meet-master/node_modules/metro/src/JSTransformer/worker.js:430:17
at Generator.next ()
at asyncGeneratorStep (/Users/rajatdhamija/Documents/jitsi-meet-master/node_modules/metro/src/JSTransformer/worker.js:75:24)
at _next (/Users/rajatdhamija/Documents/jitsi-meet-master/node_modules/metro/src/JSTransformer/worker.js:95:9)
at /Users/rajatdhamija/Documents/jitsi-meet-master/node_modules/metro/src/JSTransformer/worker.js:100:7
at new Promise ()
at /Users/rajatdhamija/Documents/jitsi-meet-master/node_modules/metro/src/JSTransformer/worker.js:92:12
at JsTransformer._minifyCode (/Users/rajatdhamija/Documents/jitsi-meet-master/node_modules/metro/src/JSTransformer/worker.js:437:7)
at /Users/rajatdhamija/Documents/jitsi-meet-master/node_modules/metro/src/JSTransformer/worker.js:367:33

getting this error while using command

./android/scripts/release-sdk.sh /tmp/repo

@saghul

We are aware of this. Something made its way into master which broke the build. You ca try the mobile-20.3 branch which corresponds with the latest release and doesn’t exhibit the problem.

Thank you. WIll try it

Could you tell me what you have done for fix this?What is the cause of this problem?

As saghul said
You ca try the mobile-20.3 branch which corresponds with the latest release and doesn’t exhibit the problem.

What is the cause of this problem?

I have the same problem on react native trying to compile in production on iOS.

Showing Recent Messages
Error: Import statement may only appear at top level in file index.js at 4:2

  • at node_modules/metro/src/JSTransformer/worker.js:430:17
  • at Generator.next ()
  • at asyncGeneratorStep (node_modules/metro/src/JSTransformer/worker.js:75:24)
  • (node_modules/metro/src/JSTransformer/worker.js:95:9)
  • node_modules/metro/src/JSTransformer/worker.js:100:7
  • at new Promise ()
  • at node_modules/metro/src/JSTransformer/worker.js:92:12
  • at JsTransformer._minifyCode (node_modules/metro/src/JSTransformer/worker.js:437:7)
  • at node_modules/metro/src/JSTransformer/worker.js:367:33

Any hint would be appreciated.

The latest SDK has this solved. Please update to version 2.10. Or if you are building it yourself, master is ok now.