Closed ghost closed 6 years ago
More detail: Currently if you include the lz4 library, there is only an alias for lib/utils.js to resolve to lib/utils-js.js.
As you can see, the alias is quite useless. Since you are providing a browser version, it should be your responsibility to provide polyfills of native node modules like Buffer or stream.
More information: Webpack Resolve Package browser field spec
Hi, after building with angular 6, which uses webpack internally, we receive ReferenceErrors during runtime because lz4 is trying to use Buffer. We were able to narrow down the issue, that even though there is a browser-version, it is not used by webpack while bundling. After we changed the browser-field in package.json to
browser: "./build/lz4.js"
everything works fine. There is a PR for that.