Skip to content

fix(client): revert "type": "commonjs" addition in generated package.json#25767

Merged
aqrln merged 1 commit intomainfrom
revert-25734-generated_client_pkg_json_type
Dec 2, 2024
Merged

fix(client): revert "type": "commonjs" addition in generated package.json#25767
aqrln merged 1 commit intomainfrom
revert-25734-generated_client_pkg_json_type

Conversation

@aqrln
Copy link
Member

@aqrln aqrln commented Dec 2, 2024

Reverts #25734 as discussed to fix #25761.

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Dec 2, 2024
@aqrln aqrln added this to the 6.0.1 milestone Dec 2, 2024
@aqrln aqrln changed the title Revert "fix: Specify 'type': 'commonjs' in generated client package.json" fix(client): evert "type": "commonjs" addition in generated package.json Dec 2, 2024
@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2024

size-limit report 📦

Path Size
packages/client/runtime/library.js 185.29 KB (0%)
packages/client/runtime/library.d.ts 81 B (0%)
packages/client/runtime/binary.js 606.42 KB (0%)
packages/client/runtime/binary.d.ts 26 B (0%)
packages/client/runtime/edge.js 161.04 KB (0%)
packages/client/runtime/edge-esm.js 160.55 KB (0%)
packages/client/runtime/wasm.js 120.89 KB (0%)
packages/client/runtime/index-browser.js 33.9 KB (0%)
packages/client/runtime/index-browser.d.ts 89 B (0%)
packages/cli/build/index.js 2.13 MB (0%)
packages/client/prisma-client-0.0.0.tgz 2.9 MB (-0.01% 🔽)
packages/cli/prisma-0.0.0.tgz 3.74 MB (-0.01% 🔽)
packages/bundle-size/da-workers-libsql/output.tgz 869.54 KB (0%)
packages/bundle-size/da-workers-neon/output.tgz 948.85 KB (0%)
packages/bundle-size/da-workers-pg/output.tgz 970.44 KB (0%)
packages/bundle-size/da-workers-pg-worker/output.tgz 922.8 KB (0%)
packages/bundle-size/da-workers-planetscale/output.tgz 883.57 KB (0%)
packages/bundle-size/da-workers-d1/output.tgz 840.31 KB (0%)

@aqrln aqrln merged commit 5adc7cc into main Dec 2, 2024
@aqrln aqrln deleted the revert-25734-generated_client_pkg_json_type branch December 2, 2024 11:26
aqrln added a commit that referenced this pull request Dec 2, 2024
@aqrln aqrln changed the title fix(client): evert "type": "commonjs" addition in generated package.json fix(client): revert "type": "commonjs" addition in generated package.json Dec 2, 2024
@P4sca1
Copy link

P4sca1 commented Dec 2, 2024

I think specifying type: commonjs is totally valid and helps in environment like deno.
To me it seems like it is an issue with Next.js if packages that correctly specify type: commonjs (prisma is a CJS package) no longer work.

@dodas
Copy link

dodas commented Dec 2, 2024

This should have been fixed in Next.js rather than reverting a valid change in prisma.
Reverting this change just supports Next.js and their invalid handling of different package formats.

@aqrln
Copy link
Member Author

aqrln commented Dec 3, 2024

You both are right and I share the sentiment, but our goal is to not break the majority of our users, and realistically we have significantly more Next.js users. This is absolutely a bug that needs to be fixed upstream and it's unfortunate that we had to revert this to work around it (thus inconveniencing Deno users again), but we have to be pragmatic. If the breakage was introduced by a sudden change in Next.js without any changes on our side, then the considerations could have been different. Sorry for this, I understand that it is frustrating to you. We'll find a way forward.

@semoal
Copy link

semoal commented Dec 3, 2024

@dodas @P4sca1 you're absolutely right, I'm pushing the issue forward on with the Next.js team, once it's resolved upstream will ping the Prisma team, even I'll introduce the cjs change again to get this resolved asap!

@mediaformat
Copy link

@semoal is there a tracking ticket or PR for this change?

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

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prisma 6.0.0 client with commonjs crashes on Next.js

7 participants