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

ReferenceError: window is not defined #2242

Closed
daniel-liuzzi opened this issue Dec 4, 2021 · 5 comments
Closed

ReferenceError: window is not defined #2242

daniel-liuzzi opened this issue Dec 4, 2021 · 5 comments

Comments

@daniel-liuzzi
Copy link

Step 3 in the Node.js SDK instructions shows LoggerProxy->error#NO LOGGER DEFINED. In fact, merely importing 'webex/env' results in this error. The actual error is ReferenceError: window is not defined and seems to be caused by H264 codec detection trying to use the window object.

Minimal repro

$ WEBEX_LOG_LEVEL=debug
$ echo "require('webex/env');" | node -

Output

LoggerProxy->error#NO LOGGER DEFINED
wx-js-sdk webex-store: constructing boundedStorage
wx-js-sdk webex-store: retrieving Device:@
wx-js-sdk storage: getting binding for `Device`
wx-js-sdk memory-store-adapter: returning binding
wx-js-sdk webex-store: retrieving User:@
wx-js-sdk storage: getting binding for `User`
wx-js-sdk memory-store-adapter: returning binding
wx-js-sdk webex-store: retrieving Credentials:@
wx-js-sdk storage: getting binding for `Credentials`
wx-js-sdk memory-store-adapter: returning binding
wx-js-sdk storage: made binding for `Device`
wx-js-sdk storage: made binding for `User`
wx-js-sdk storage: made binding for `Credentials`
wx-js-sdk memory-store-adapter: reading `@`
wx-js-sdk memory-store-adapter: reading `@`
wx-js-sdk memory-store-adapter: reading `@`
wx-js-sdk storage:(Device): got `@` for first time
wx-js-sdk storage:(Device): set `@` for first time
wx-js-sdk storage:(User): got `@` for first time
wx-js-sdk storage:(User): set `@` for first time
wx-js-sdk storage:(Credentials): got `@` for first time
wx-js-sdk storage:(Credentials): set `@` for first time
wx-js-sdk meetings:onReady->event#meetings:ready -- undefined
wx-js-sdk webex-store: removing Credentials:@
wx-js-sdk storage: getting binding for `Credentials`
wx-js-sdk storage: found binding for `Credentials`
wx-js-sdk memory-store-adapter: deleting `@`
@ralagana
Copy link

ralagana commented Jan 6, 2022

Hi @daniel-liuzzi , this issue should be fixed now (PR: #2250), can you check again please?

@daniel-liuzzi
Copy link
Author

Hi @ralagana,

So I updated to the latest webex (currently 1.154.0) and re-tested. The LoggerProxy->error#NO LOGGER DEFINED error is gone, but now a different error comes up:

$ echo "require('webex/env');" | node -
wx-js-sdk Meetings:util#hasH264Codec --> Error creating peerConnection for H.264 test.

From the looks of it, it seems related; I would think H.264 is available from a web browser but not from Node.js, but I'm no expert, so not 100% sure.

In any case, sorry for the late reply and thanks for your PR!

@daniel-liuzzi
Copy link
Author

I'm not sure how I tested this. Today I tried with the latest 1.161.0 as well as 1.154.0 mentioned in my previous comment. Both still show the LoggerProxy->warn#NO LOGGER DEFINED warning originally reported.

@ricardocasares
Copy link

Having issues with v3.0.0

Welcome to Node.js v20.12.0.
Type ".help" for more information.
> require('webex')
Uncaught ReferenceError: window is not defined
    at Object.<anonymous> (/Users/ricasare/Code/<REDACTED>/<REDACTED>/node_modules/@webex/plugin-meetings/node_modules/@webex/internal-media-core/dist/cjs/index.js:2065:29024)
    at Module._compile (node:internal/modules/cjs/loader:1369:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
    at Module.load (node:internal/modules/cjs/loader:1206:32)
    at Module._load (node:internal/modules/cjs/loader:1022:12)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at require (node:internal/modules/helpers:179:18)
>

@sreenara
Copy link
Contributor

@ricardocasares please follow #3510 where we are working on the root cause of the problem and a fix. Will be closing this one.

@sreenara sreenara closed this as not planned Won't fix, can't repro, duplicate, stale Apr 22, 2024
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

4 participants