Cant find variable : window error

Hi Team,
I am getting “Can’t find variable : window” error when I tried to run the when I run the react-native android app in my local Mac machine. Pleas find the Error Screenshot below for your reference. Can you provide your insights.

Which version of jitsi-meet do you try? Do you have any modifications?

Sorry I am new to Jitsi development. I could see version 0.0.0 in the package.json. Can you please let me know where I could find the jits-meet version? Yes we have made customization changes on the web part. Didn’t touch the native code yet. Just now I am starting with it.

FYI, I tried running the react-native app by cloning the latest master, it works fine. But it doesnt work in my version.

So your modifications are accessing window somewhere … or something like that in the react-native code and this is not working … you need to figure out which of your changes broke it and fix it.

Probably your changes are not only for the web, but are touching code that is shared between web and mobile.

A lot of the js code is shared between web and mobile. The native code is just a wrapper and very few things are there which cannot go in the js code.

Thanks for providing your insights. I will check my code.

I tried removing all window references used in the customisation what I did but still I land up in the same error. So I debugged with the error trace to the line where the window error was referred in the build file. It is calling csioReactNative. Do you know what it is?
Attached screenshot for your reference.

Also I could see an open issue in github where one other guy face the same issue with fresh code setup (without customisation). Can't find variable : window · Issue #8674 · jitsi/jitsi-meet · GitHub

No idea. Probably is coming from some import … jitsi-meet/RTCPeerConnection.js at caabdadf19ae5def3f8173acec6c49111f50a04e · jitsi/jitsi-meet · GitHub

I would guess that you are either missing an import or you are re-ordering how things are loaded in jitsi-meet and that’s why it does not work with your modifications … but this is a wild guess …

Hi guys,

Just wanted to add I also have the same problem even when I try to compile the jitsi ios app without any customizations. I opened a ticket here

The only difference between success and failure in my tests seems to be related to the npm version as explained in the ticket (ie npm 7.6.3 seems to work but newer versions don’t).

Thanks @pdarcos , My npm version is 7.9.0. I tried downgrading it to 7.6.3 but it didnt help. Same error still persists.

Here are the exact steps to reproduce the issue,

  1. Take the latest clone from master
  2. Delete the package-lock.json
  3. npm install
  4. npx react-native start
  5. npx react-native run-android

node version:12.18.3
npm version: 7.9.0

we will get the error

the some issue, do you have any solutions?

Try downgrading the npm version below 7.0