kube/monolite

ReferenceError: window is not defined in node_modules/monolite/lib/monolite/index.js:1

Closed this issue · 7 comments

ellis commented

I just installed the latest version of monolite, but when I import it into a script, I get the following error:

ReferenceError: window is not defined

/.../node_modules/monolite/lib/monolite/index.js:1

If I edit index.js and replace the one instance of window with {}, then everything runs as expected. Any idea why the superfluous window reference is in index.js?

Cheers!

Hi, would you accept a PR containing the suggested change ?

kube commented

@medfreeman Sorry, just coming back here. (Gonna try to keep my Github notifications clean from now on)
If you are still interested of course, I would be happy to see people contributions.
I really need to update and maintain this library though.

kube commented

This is because of webpack/webpack#6522
I'm gonna create a fix for it. (I did update all packages this weekend, and did setup automatic NPM publish to be able to update easily this library.

Nice, thanks a lot!

kube commented

Should be fixed now.
I know it's been a long time since the issue creation, but do not hesitate to come back creating an issue if you face any issue with the library.

With 0.9.0, i still get the error while calling the function:

ReferenceError: window is not defined
[redacted module]:     at Object.<anonymous> (/[redacted path]/node_modules/monolite/dist/index.js:1)
kube commented

Ok there was an issue with deployment.
Should be fine now. I tested it manually from CodeSandbox both on Node and Browser.

Thanks for your report.