Open kristoferjoseph opened 10 years ago
npm sux
Having a bit of a play with browserify and the master branch I can see that it might be worth waiting before doing a new npm publish. From what I can tell, the following piece of code and browserify are not playing nicely together:
var glob = {
win: window,
doc: window.document
};
Essentially, glob.doc
ends up being undefined
. Unsure of what the exact problem is but I'll try and dig into it a little...
OK, this problem comes down to the following line:
https://github.com/adobe-webplatform/Snap.svg/blob/master/dist/snap.svg.js#L434
While this works in the browser standalone, once encapsulated within the browserify prelude stuff this
becomes the simulated module rather than the Window
instance, which is what you were expecting it to be.
The current version on npm is 3.0, but has the old main property. It looks as though 3.0 was published multiple times. npm will not overwrite an existing version number due to security issues. Incrementing the version here: https://github.com/adobe-webplatform/Snap.svg/blob/master/package.json#L3 to 3.x would be sufficient to fix this issue.
Thanks :)