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 #29

Closed
alexhung opened this issue Sep 27, 2016 · 4 comments
Closed

ReferenceError: window is not defined #29

alexhung opened this issue Sep 27, 2016 · 4 comments
Labels

Comments

@alexhung
Copy link

alexhung commented Sep 27, 2016

Install via npm, open node REPL and got this when trying to require the lib:

ReferenceError: window is not defined
    at Object.<anonymous> (/Volumes/Data/Users/.../node_modules/js-video-url-parser/dist/jsVideoUrlParser.js:775:4)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at repl:1:17
    at REPLServer.defaultEval (repl.js:252:27)
    at bound (domain.js:287:14)

Same error when I use it in my node project.

@Zod-
Copy link
Owner

Zod- commented Sep 27, 2016

Shouldn't it just pass it as undefined when window is not defined? })(window);
I'm doing a nil check later on, didn't really expect this to break.

@Zod- Zod- added the bug label Sep 27, 2016
Zod- added a commit that referenced this issue Sep 28, 2016
@Zod-
Copy link
Owner

Zod- commented Sep 28, 2016

@alexhung could you give it a try with these changes.

@Zod- Zod- closed this as completed Sep 29, 2016
@StephanGeorg
Copy link

Yes, this works. Would you please submit it to npm?

@Zod-
Copy link
Owner

Zod- commented Oct 12, 2016

Oh man I totally forgot to actually publish it. Sorry about that.

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

No branches or pull requests

3 participants