Skip to content

fix(privacy-types): bundle CJS deps to fix ESM resolution error#67

Closed
michaelfarrell76 wants to merge 3 commits into
mainfrom
fix/privacy-types-esm-cjs-compat
Closed

fix(privacy-types): bundle CJS deps to fix ESM resolution error#67
michaelfarrell76 wants to merge 3 commits into
mainfrom
fix/privacy-types-esm-cjs-compat

Conversation

@michaelfarrell76
Copy link
Copy Markdown
Member

type-utils and internationalization are CJS packages without an "exports" field, so Node.js ESM resolution fails when privacy-types (an ESM package) re-exports them as bare specifiers. Bundle them into the output instead and move to devDependencies.

Screenshot 2026-04-07 at 6 02 08 PM

Error: Cannot find package '@transcend-io/type-utils' imported from /home/runner/work/main/main/.yarn/cache/@transcend-io-privacy-types-npm-5.0.1-cc3362a02c-e5f6654b22.zip/node_modules/@transcend-io/privacy-types/dist/index.mjs
Did you mean to import "@transcend-io/type-utils/build/index.js"?

type-utils and internationalization are CJS packages without an
"exports" field, so Node.js ESM resolution fails when privacy-types
(an ESM package) re-exports them as bare specifiers. Bundle them into
the output instead and move to devDependencies.
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 8, 2026

Open in StackBlitz

@transcend-io/cli

pnpm add https://pkg.pr.new/@transcend-io/cli@67
yarn add https://pkg.pr.new/@transcend-io/cli@67.tgz

@transcend-io/privacy-types

pnpm add https://pkg.pr.new/@transcend-io/privacy-types@67
yarn add https://pkg.pr.new/@transcend-io/privacy-types@67.tgz

@transcend-io/sdk

pnpm add https://pkg.pr.new/@transcend-io/sdk@67
yarn add https://pkg.pr.new/@transcend-io/sdk@67.tgz

@transcend-io/utils

pnpm add https://pkg.pr.new/@transcend-io/utils@67
yarn add https://pkg.pr.new/@transcend-io/utils@67.tgz

commit: 137aeea

@bencmbrook
Copy link
Copy Markdown
Member

bencmbrook commented Apr 8, 2026

@michaelfarrell76 any chance we can publish ESM versions for those instead?

I imagine this will cause big bundle growth and may make it to frontend JS bundles

@michaelfarrell76
Copy link
Copy Markdown
Member Author

@bencmbrook that seems fine but i dont know how to update those to do that, do you?

@bencmbrook
Copy link
Copy Markdown
Member

@bencmbrook that seems fine but i dont know how to update those to do that, do you?

Yeah I can help tomorrow

@bencmbrook
Copy link
Copy Markdown
Member

bencmbrook commented Apr 8, 2026

@michaelfarrell76 transcend-io/internationalization#31 and transcend-io/type-utils#48

separately, might make sense to port these over to this repo

@michaelfarrell76
Copy link
Copy Markdown
Member Author

@bencmbrook ya no problem doing that!

@michaelfarrell76
Copy link
Copy Markdown
Member Author

@bencmbrook whats next step here? want me to take over?

Copy link
Copy Markdown
Member

Yes please—I think you can just close this PR and then bump the versions of these two packages and that should solve the ESM resolution problem (now it's all ESM!)

@michaelfarrell76
Copy link
Copy Markdown
Member Author

@bencmbrook sg, should we also move those in here or you dont think so?

@bencmbrook
Copy link
Copy Markdown
Member

@bencmbrook sg, should we also move those in here or you dont think so?

I don't feel strongly. It's probably easier to maintain if they're in here

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.

2 participants