Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When setting custom client output directory, generated package.json does not include "sideEffects: false" #15301

Closed
boblauer opened this issue Sep 13, 2022 · 0 comments · Fixed by #19229
Labels
bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/bug A reported bug. team/client Issue for team Client.
Milestone

Comments

@boblauer
Copy link

Bug description

When you generate the prisma client without specifying a custom path, the package.json at @prisma/client/package.json will specify sideEffects: false.

However, when you specify a custom path in your schema.prisma file, the generated json does not specify sideEffects: false, and so the package will not be tree-shaken from your client-side bundle.

How to reproduce

  1. Modify schema.prisma to include output = './some-custom-path' within the generator client section
  2. npx prisma generate
  3. Navigate to the generated output directory and open package.json
  4. See that sideEffects: false is not present

Expected behavior

I would expect the package.json to include sideEffects: false just as it does when not specifying a custom path.

Prisma information

generator client {
  provider      = "prisma-client-js"
  binaryTargets = "native"
  output        = "./../../node_modules/@bug/prisma-client"
}

Environment & setup

  • OS: macOS
  • Database: PostgreSQL
  • Node.js version: 16.3.0

Prisma Version

3.15.2
@boblauer boblauer added the kind/bug A reported bug. label Sep 13, 2022
@pimeys pimeys added team/client Issue for team Client. bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. labels Sep 16, 2022
@millsp millsp added this to the 4.15.0 milestone May 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/bug A reported bug. team/client Issue for team Client.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants