Conversation
#29286) ## Summary Fixes #29257 When importing `Prisma.DbNull` from the browser entry point (`./generated/prisma/browser`) and passing it to `prisma.create()` in a bundled environment like Next.js, the value is serialized as `{}` instead of `NULL`. **Root cause:** The serialization code uses `instanceof ObjectEnumValue` to detect `DbNull`/`JsonNull`/`AnyNull` values. In bundled environments (e.g., Next.js with webpack/turbopack), the browser and server entry points may resolve to separate copies of `@prisma/client-runtime-utils`, creating different class instances. The `instanceof` check fails across these bundle boundaries, causing `DbNull` to fall through to the generic object serialization path and become `{}`. **Fix:** Replace all `instanceof ObjectEnumValue` checks with a new `isObjectEnumValue()` duck-typing function that checks for the `_getName` and `_getNamespace` methods. This follows the existing `isDecimalJsLike` pattern already used in the codebase for cross-bundle Decimal detection. ### Changes - **`client-runtime-utils/src/nullTypes.ts`**: Add `isObjectEnumValue()` duck-typing function - **`client/src/runtime/index-browser.ts`**: Export `isObjectEnumValue` - **`client/src/runtime/index.ts`**: Export `isObjectEnumValue` - **`client/src/runtime/core/jsonProtocol/serializeJsonQuery.ts`**: Use `isObjectEnumValue()` instead of `instanceof ObjectEnumValue`; validate by name string instead of singleton identity - **`client/src/runtime/utils/deepCloneArgs.ts`**: Use `isObjectEnumValue()` instead of `instanceof ObjectEnumValue` - **`client/src/runtime/core/errorRendering/ArgumentsRenderingTree.ts`**: Use `isObjectEnumValue()` instead of `instanceof ObjectEnumValue` ## Test plan - [x] All 57 `serializeJsonQuery` tests pass - [x] All 4 `deepCloneArgs` tests pass - [x] All 24 `ArgumentsRenderingTree` tests pass - [x] ESLint: 0 errors - [x] Pre-commit hooks pass (prettier + eslint) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a public utility to reliably detect object enum values across bundle boundaries and exported it from the runtime. * **Bug Fixes** * Improved detection and serialization of object enum/null-like values coming from other bundles, preventing incorrect stringification or validation errors. * **Tests** * Added tests covering cross-bundle enum/null detection, serialization, and preservation during deep-cloning. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: jacek-prisma <malec@prisma.io>
…89889514053 (#29321) The base branch for this PR is: main This automatic PR updates the engines to version `7.5.0-11.7b8301120d804d084ab24ec6332a889889514053`. This will get automatically merged if all the tests pass. :warning: If this PR needs to be updated, first remove the `automerge` label before pushing to avoid automerge to merge without waiting for tests. ## Packages | Package | NPM URL | |---------|---------| |`@prisma/engines-version`| https://npmjs.com/package/@prisma/engines-version/v/7.5.0-11.7b8301120d804d084ab24ec6332a889889514053| |`@prisma/prisma-schema-wasm`| https://npmjs.com/package/@prisma/prisma-schema-wasm/v/7.5.0-11.7b8301120d804d084ab24ec6332a889889514053| |`@prisma/query-compiler-wasm`| https://npmjs.com/package/@prisma/query-compiler-wasm/v/7.5.0-11.7b8301120d804d084ab24ec6332a889889514053| |`@prisma/schema-engine-wasm`| https://npmjs.com/package/@prisma/schema-engine-wasm/v/7.5.0-11.7b8301120d804d084ab24ec6332a889889514053| ## Engines commit [`prisma/prisma-engines@7b8301120d804d084ab24ec6332a889889514053`](prisma/prisma-engines@7b83011) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated internal dependencies to latest versions. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary
- update `@prisma/studio-core` in `packages/cli` and the lockfile to the
new `0.21.1` release so Studio pulls the latest bundle
- Adapted BFF to support SQL linting
- refresh lockfile metadata so downstream installs resolve the updated
package version
Studio Features
- More intuitive filtering
- Filter by SQL
- fulltext search across all columns
- SQL Query tab
## BFF changes
Implemented the CLI-side BFF extension needed for newer Studio SQL
linting.
What changed:
- Added support for the `sql-lint` BFF procedure in
`packages/cli/src/Studio.ts`
- Forwarded `sql-lint` requests to `executor.lintSql(...)` when the
executor supports it
- Kept an explicit fallback for executors that do not implement SQL lint
- Improved BFF error normalization so already-serialized upstream errors
are passed through unchanged, including RPC envelopes like `{"@@error":
...}`
Why this is needed:
- `@prisma/studio-core` now sends SQL lint requests through the BFF as
`procedure: "sql-lint"`
- Without handling that procedure in the CLI, Studio falls through to
`Unknown procedure`
- Some upstream failures arrive as serialized RPC error envelopes rather
than native `Error` instances, so the CLI needs to unwrap those instead
of turning them into generic fallback errors
Result:
- SQL query linting works through the CLI BFF
- When linting fails, Studio now gets the real database error payload
instead of a generic `Unknown procedure` or fallback error
Validation:
- Added focused Vitest coverage for:
- routing `sql-lint` requests through the BFF
- unwrapping `@@error`-serialized failures
- `pnpm --filter prisma test src/__tests__/Studio.vitest.ts` passes
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added server-side SQL linting for the Studio backend endpoint.
* **Bug Fixes**
* Standardized BFF-style error formatting and unwrapping for more
consistent backend error responses.
* **Tests**
* New tests for the SQL lint flow, error-unwrapping behavior, and
related server-side handling.
* **Chores**
* Updated dependency versions for improved compatibility.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
…767f1f76fc2 (#29323) The base branch for this PR is: main This automatic PR updates the engines to version `7.5.0-13.0f1690a1b5dcd01b5341a4f411f07767f1f76fc2`. This will get automatically merged if all the tests pass. :warning: If this PR needs to be updated, first remove the `automerge` label before pushing to avoid automerge to merge without waiting for tests. ## Packages | Package | NPM URL | |---------|---------| |`@prisma/engines-version`| https://npmjs.com/package/@prisma/engines-version/v/7.5.0-13.0f1690a1b5dcd01b5341a4f411f07767f1f76fc2| |`@prisma/prisma-schema-wasm`| https://npmjs.com/package/@prisma/prisma-schema-wasm/v/7.5.0-13.0f1690a1b5dcd01b5341a4f411f07767f1f76fc2| |`@prisma/query-compiler-wasm`| https://npmjs.com/package/@prisma/query-compiler-wasm/v/7.5.0-13.0f1690a1b5dcd01b5341a4f411f07767f1f76fc2| |`@prisma/schema-engine-wasm`| https://npmjs.com/package/@prisma/schema-engine-wasm/v/7.5.0-13.0f1690a1b5dcd01b5341a4f411f07767f1f76fc2| ## Engines commit [`prisma/prisma-engines@0f1690a1b5dcd01b5341a4f411f07767f1f76fc2`](prisma/prisma-engines@0f1690a) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated internal dependencies across multiple packages to the latest versions. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )