Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"window is not defined" error comes from erizofc.js #1681

Open
grokker001 opened this issue Feb 5, 2021 · 0 comments
Open

"window is not defined" error comes from erizofc.js #1681

grokker001 opened this issue Feb 5, 2021 · 0 comments

Comments

@grokker001
Copy link

grokker001 commented Feb 5, 2021

Description

I checked out from the master branch and trying to test the nodejs client. In the steps in the document, I have to import the built "erizofc.js" file. But when I tried to call

room = Erizo.Room(newIo, nativeConnectionHelpers, nativeConnectionManager, { token });

I got the following error:

2021-02-05 16:52:35.923 - INFO: ErizoSimpleNativeConnection - Getting token eyJ0b2tlbklkIjoiNjAxZGNjMzNlOGQ5ZmYxMjljNjRkMjA5IiwiaG9zdCI6ImxpY29kZS10ZXN0LnJ0Y2h1Yi5pbzo0NDMiLCJzZWN1cmUiOnRydWUsInNpZ25hdHVyZSI6Ik1HVXpPREV3TlRBeE9XVmhORFJrT1dFNE5tUTVNMk13TkRabFltTmhNbVpoWVRreU16aGlNQT09In0=
/home/user/projects/licode/spine/erizofc.js:7767
window.addEventListener('beforeunload', onBeforeUnload);
^

ReferenceError: window is not defined
at Socket (/home/user/projects/licode/spine/erizofc.js:7767:3)
at Object.Room (/home/user/projects/licode/spine/erizofc.js:3632:79)
at /home/user/projects/licode/spine/simpleNativeConnection.js:75:20
at exports.XMLHttpRequest.req.onreadystatechange (/home/user/projects/licode/spine/simpleNativeConnection.js:46:11)
at exports.XMLHttpRequest.dispatchEvent (/home/user/projects/licode/spine/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:534:25)
at setState (/home/user/projects/licode/spine/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:553:14)
at IncomingMessage. (/home/user/projects/licode/spine/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:403:13)
at IncomingMessage.emit (events.js:215:7)
at endReadableNT (_stream_readable.js:1183:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)

Steps to reproduce the issue:

  1. Build and install Licode from master branch
  2. Start Licode and Basic example make sure Basic example works in the browser
  3. Update /spine/spineClientsConfig.json file with the environment's setup
  4. in /spine folder, run "node runSpineClients.js"

Describe the results you received:

ReferenceError: window is not defined

Describe the results you expected:

The test should process without errors. My understanding is if I want to run the nodejs client, there should be no global "window" object referred in the code, is it correct?

Additional environment details (Local, AWS, Docker, etc.):
Local

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant