Skip to content

Conversation

@aidant
Copy link

@aidant aidant commented Sep 8, 2025

The current browser bundle is misleading. It points to the es-toolkit/compat and does not contain any exports. This means if you import { flatten } from "es-toolkit" in a bundler which prioritises the browser field flatten will be undefined. Alternatively if you intended to import "es-toolkit" and use a method not exposed by the es-toolkit/compat layer such as flattenObject the function will be undefined. Since its common for bundlers to wrap the modules the _ global may also not be exposed.

The simplest fix is to remove the browser bundle and let bundlers take over, however, if there is a desire to expose a script which provides the es-toolkit/compat layer as a global I suggest we explore moving it to a new subpath export.

@vercel
Copy link

vercel bot commented Sep 8, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
es-toolkit Ready Ready Preview Comment Sep 8, 2025 1:39am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant