ssttevee / js-blob-ponyfill

MIT License
0 stars 0 forks source link

The import paths are not fully qualified. #3

Open ritave opened 1 year ago

ritave commented 1 year ago

Since this package is "type": "module", relative import urls must include the extension.

Otherwise tools like WebPack bail out:

Module not found: Error: Can't resolve './blob' in '<redacted>/node_modules/@ssttevee/blob-ponyfill'
Did you mean 'blob.js'?
BREAKING CHANGE: The request './blob' failed to resolve only because it was resolved as fully specified
ssttevee commented 1 year ago

Are you using this in cloudflare workers?

If you are, I believe Blobs are now natively supported in the runtime, so this package is no longer necessary.

I'll fix it if you have another use case for this package.

ritave commented 1 year ago

I'm using this in local Node / browser extension environment. MetaMask needs to support both Node v16 and Node v18.

https://github.com/MetaMask/snaps-skunkworks/pull/788/files#diff-e993e76d91e2259f908e9b22eca7b19e081b3265fc02bafd43752033a435dd84R452

In the end we decided not to pursue due to maintenance cost, but this is still a problem for this library :)

Adding the extenions solve all issues with WebPack

By the way, js-formdata-ponyfill is CommonJS while this is ESM. It's hard to get them working nicely.