Skip to content

feat(client): validate constructor#4176

Merged
timsuchanek merged 6 commits intomasterfrom
validate-constructor
Nov 9, 2020
Merged

feat(client): validate constructor#4176
timsuchanek merged 6 commits intomasterfrom
validate-constructor

Conversation

@timsuchanek
Copy link
Copy Markdown
Contributor

@Jolg42
Copy link
Copy Markdown
Contributor

Jolg42 commented Nov 9, 2020

Looks like Studio tests are failing https://github.com/prisma/prisma/pull/4176/checks?check_run_id=1364713203#step:6:592

 Generating Prisma Client ... done
  console.error
    Unable to start Prisma Client:  PrismaClientValidationError: Unknown property engine provided to PrismaClient constructor.
        at validatePrismaClientOptions (/home/runner/.cache/prisma/studio/home-runner-work-prisma-prisma-src-packages-cli-src-__tests__-fixtures-studio-test-project/runtime/index.js:77932:13)
        at new NewPrismaClient (/home/runner/.cache/prisma/studio/home-runner-work-prisma-prisma-src-packages-cli-src-__tests__-fixtures-studio-test-project/runtime/index.js:77996:9)
        at Photon.start (/home/runner/work/prisma/prisma/src/node_modules/.pnpm/@prisma/[email protected]/node_modules/@prisma/studio-transports/build/photon.js:92:33)
        at runMicrotasks (<anonymous>)
        at processTicksAndRejections (internal/process/task_queues.js:97:5)
        at PhotonService.respond (/home/runner/work/prisma/prisma/src/node_modules/.pnpm/@prisma/[email protected]/node_modules/@prisma/studio-server/build/services/PhotonService.js:88:25)
        at Object.StudioServer.onWSMessage [as callback] (/home/runner/work/prisma/prisma/src/node_modules/.pnpm/@prisma/[email protected]/node_modules/@prisma/studio-server/build/StudioServer.js:79:35)

      at Photon.start (../../node_modules/.pnpm/@prisma/[email protected]/node_modules/@prisma/studio-transports/build/photon.js:132:25)
          at runMicrotasks (<anonymous>)
      at PhotonService.respond (../../node_modules/.pnpm/@prisma/[email protected]/node_modules/@prisma/studio-server/build/services/PhotonService.js:88:25)
      at Object.StudioServer.onWSMessage [as callback] (../../node_modules/.pnpm/@prisma/[email protected]/node_modules/@prisma/studio-server/build/StudioServer.js:79:35)

@timsuchanek
Copy link
Copy Markdown
Contributor Author

@Jolg42 yep. @madebysid and I are already debugging

@timsuchanek timsuchanek added this to the Release 2.11.0 milestone Nov 9, 2020
expect(() =>
validatePrismaClientOptions(
{
errorrFormat: 'minimal',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to mess with some brains? 😄

Comment thread src/packages/client/src/runtime/utils/validatePrismaClientOptions.ts Outdated
Copy link
Copy Markdown
Contributor

@Jolg42 Jolg42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jolg42
Copy link
Copy Markdown
Contributor

Jolg42 commented Nov 9, 2020

Note From what I understand it fails at the first error found ✅

@Jolg42
Copy link
Copy Markdown
Contributor

Jolg42 commented Nov 9, 2020

✨ Nice!

@timsuchanek timsuchanek merged commit 8c30e14 into master Nov 9, 2020
@timsuchanek timsuchanek deleted the validate-constructor branch November 9, 2020 16:42
Jolg42 added a commit that referenced this pull request Nov 10, 2020
* master:
  fix: fork Node generators (#4214)
  chore(deps): update studio to v0.311.0
  fix: bump engines (#4207)
  ci: Test Buildkite config 10 & 14
  ci: revert buildkite test pipeline [skip ci]
  ci: test Buildkite config
  ci: test Buildkite config
  chore(deps): update dependency @types/node to v12.19.4
  chore(deps): update devdependencies (non-major)
  feat(client): validate constructor (#4176)
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.

Runtime validation for Prisma client constructor parameters

2 participants