Closed streamich closed 1 year ago
Constants are platform dependent. Have you tried bundling with latest? It works fine for me due to the browser field
Feel free to open an issue if not
Ah, I totally missed that they can be different per platform, sorry about that.
For me the browser
field causes problems, I'm bundling with Webpack and overwriting the fs
module with Webpack's resolve.fallback
feature. When the browser.fs = false
field is present it imports the fs
module as empty object:
When I remove the browser
field, it rewrites the fs
module with what ever I specify as expected.
After some searching found this:
The empty object is what causes the problems, at least for me, it results into constants
being undefined
, and once retrieving some constant it throws.
This change removes
fs
dependency which greatly simplifies bundling of this package for web. Should have no effect on Node.js users.