kube / monolite

Statically-typed structural-sharing tree modifier
https://www.npmjs.com/package/monolite
148 stars 6 forks source link

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

Closed ellis closed 4 years ago

ellis commented 5 years ago

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!

medfreeman commented 5 years ago

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

kube commented 4 years ago

@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 4 years ago

This is because of https://github.com/webpack/webpack/issues/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.

medfreeman commented 4 years ago

Nice, thanks a lot!

kube commented 4 years ago

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.

medfreeman commented 4 years ago

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 4 years ago

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.