unfetch icon indicating copy to clipboard operation
unfetch copied to clipboard

fix: do not use uninitialised `self`

Open radiosilence opened this issue 2 years ago • 1 comments

This should fix snowpack and other loaders that don't expect libraries to do odd things.

radiosilence avatar Jul 23 '21 11:07 radiosilence

Can we please merge this? I'm using webpack and having this issue.

rockstar avatar Aug 13 '21 15:08 rockstar

Can someone clarify what the actual issue is here? self is a browser global and this is a browser module, this should have nothing to do with snowpack or any other tool. global isn't defined in browser environments (where this code runs), so this PR would break a bunch of (other?) tools.

Perhaps the issue is actually that the browser code is being used under Node? if so that should be fixed by this commit which adds an export map.

developit avatar Dec 31 '22 02:12 developit

closing since I'm fairly certain this is really about the export map, but please feel free to reopen if that fix didn't actually address.

developit avatar Dec 31 '22 02:12 developit

Reopening because I'm using vite to bundle a library and when integrating with a next.js app I'm still seeing the self is not defined error when it tries to make a request on the server.

kmcaloon avatar Sep 18 '23 15:09 kmcaloon