Skip to content

cheerio dependency breaks browserify compatibility since juice@7.0.0 #536

@manosKas

Description

@manosKas

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions