Summary
Starting with juice@7.0.0, the package is no longer browserify-compatible due to changes in the cheerio dependency. Up to juice@6.0.0, everything works fine in the browser when bundling with Browserify.
Details
juice@6.0.0 uses cheerio@0.x, which is CommonJS and compatible with Browserify.
- From
juice@7.0.0 onward, the package depends on cheerio@1.x, which:
- Uses ESM
- Requires Node built-ins like
node:stream
- Fails in Browserify with errors like:
Error: Can't walk dependency graph: ENOENT: no such file or directory, lstat '.../node:stream'
Use Case
I'm using Juice to inline CSS for rendering HTML emails in a browser-based email client. This worked great with juice@6.0.0, but updating breaks bundling completely.
Suggested Actions
- Document this breaking change more explicitly in the README and changelog.
- Consider publishing a legacy browser-compatible build or offering an ESM/browser build via
juice/client.
Temporary Workaround
Downgrading to juice@6.0.0 restores Browserify compatibility.
Let me know if you're open to a PR, or if there's a preferred way to browserify recent versions.
Summary
Starting with
juice@7.0.0, the package is no longer browserify-compatible due to changes in thecheeriodependency. Up tojuice@6.0.0, everything works fine in the browser when bundling with Browserify.Details
juice@6.0.0usescheerio@0.x, which is CommonJS and compatible with Browserify.juice@7.0.0onward, the package depends oncheerio@1.x, which:node:streamUse Case
I'm using Juice to inline CSS for rendering HTML emails in a browser-based email client. This worked great with
juice@6.0.0, but updating breaks bundling completely.Suggested Actions
juice/client.Temporary Workaround
Downgrading to
juice@6.0.0restores Browserify compatibility.Let me know if you're open to a PR, or if there's a preferred way to browserify recent versions.