Skip to content

Conversation

@orimay
Copy link
Contributor

@orimay orimay commented Nov 18, 2025

Thank you for submitting this pull request! We appreciate you spending the time to work on these changes.

What is the motivation?

db.live is documented to accept RecordId and RecordIdRange, but only accepts Table

What does this change do?

Provide a description of what this pull request does.

What is your testing strategy?

I ran bun i (which created bun.lockb, totally ignoring bun.lock, despite me installing exact bun version from the package.json) and bun run test, but I faced the following issue:

dmitriibaranov@Dmitriis-MacBook-Pro surrealdb.js % bun run test
$ bun run build:sdk && cd packages/tests && bun test --preload ./global.ts
$ turbo build --filter=surrealdb
turbo 2.6.1

• Packages in scope: surrealdb
• Running build in 1 packages
• Remote caching disabled
surrealdb:build: cache miss, executing 0decbd762f5efae0
surrealdb:build: 
surrealdb:build: $ bun run build.ts
surrealdb:build: 382 |  nativeBinding = require_webcontainer_fallback();
surrealdb:build: 383 | } catch (err) {
surrealdb:build: 384 |  loadErrors.push(err);
surrealdb:build: 385 | }
surrealdb:build: 386 | if (!nativeBinding) {
surrealdb:build: 387 |  if (loadErrors.length > 0) throw new Error("Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.", { cause: loadErrors });
surrealdb:build:                                         ^
surrealdb:build: error: Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.
surrealdb:build:  cause: [
surrealdb:build:   {
surrealdb:build:     "name": "ResolveMessage",
surrealdb:build:     "position": null,
surrealdb:build:     "message": "Cannot find module \"../rolldown-binding.darwin-universal.node\" from \"/Users/dmitriibaranov/Projects/surrealdb.js/node_modules/rolldown/dist/shared/parse-ast-index-B-b57oWx.mjs\"",
surrealdb:build:     "level": "error",
surrealdb:build:     "specifier": "../rolldown-binding.darwin-universal.node",
surrealdb:build:     "importKind": "require-call",
surrealdb:build:     "referrer": "/Users/dmitriibaranov/Projects/surrealdb.js/node_modules/rolldown/dist/shared/parse-ast-index-B-b57oWx.mjs"
surrealdb:build:   },
surrealdb:build:   {
surrealdb:build:     "name": "ResolveMessage",
surrealdb:build:     "position": null,
surrealdb:build:     "message": "Cannot find module \"@rolldown/binding-darwin-universal\" from \"/Users/dmitriibaranov/Projects/surrealdb.js/node_modules/rolldown/dist/shared/parse-ast-index-B-b57oWx.mjs\"",
surrealdb:build:     "level": "error",
surrealdb:build:     "specifier": "@rolldown/binding-darwin-universal",
surrealdb:build:     "importKind": "require-call",
surrealdb:build:     "referrer": "/Users/dmitriibaranov/Projects/surrealdb.js/node_modules/rolldown/dist/shared/parse-ast-index-B-b57oWx.mjs"
surrealdb:build:   },
surrealdb:build:   {
surrealdb:build:     "name": "ResolveMessage",
surrealdb:build:     "position": null,
surrealdb:build:     "message": "Cannot find module \"../rolldown-binding.darwin-arm64.node\" from \"/Users/dmitriibaranov/Projects/surrealdb.js/node_modules/rolldown/dist/shared/parse-ast-index-B-b57oWx.mjs\"",
surrealdb:build:     "level": "error",
surrealdb:build:     "specifier": "../rolldown-binding.darwin-arm64.node",
surrealdb:build:     "importKind": "require-call",
surrealdb:build:     "referrer": "/Users/dmitriibaranov/Projects/surrealdb.js/node_modules/rolldown/dist/shared/parse-ast-index-B-b57oWx.mjs"
surrealdb:build:   },
surrealdb:build:   {
surrealdb:build:     "code": "ObjectExpected"
surrealdb:build:   }
surrealdb:build: ]
surrealdb:build: 
surrealdb:build:       at /Users/dmitriibaranov/Projects/surrealdb.js/node_modules/rolldown/dist/shared/parse-ast-index-B-b57oWx.mjs:387:35
surrealdb:build: 
surrealdb:build: Bun v1.1.17 (macOS arm64)
surrealdb:build: error: script "build" exited with code 1
surrealdb:build: ERROR: command finished with error: command (/Users/dmitriibaranov/Projects/surrealdb.js/packages/sdk) /opt/homebrew/bin/bun run build exited (1)
surrealdb#build: command (/Users/dmitriibaranov/Projects/surrealdb.js/packages/sdk) /opt/homebrew/bin/bun run build exited (1)

 Tasks:    0 successful, 1 total
Cached:    0 cached, 1 total
  Time:    827ms 
Failed:    surrealdb#build

 ERROR  run failed: command  exited (1)
error: script "build:sdk" exited with code 1
error: script "test" exited with code 1

Didn't find a way to fix this. So I ended up going through the code and adding some tests. I hope they pass :)

Is this related to any issues?

#501

Have you read the Contributing Guidelines?

@orimay orimay requested a review from kearfy as a code owner November 18, 2025 12:44
@ShadowWolf308
Copy link

Hey @orimay
looking through the error that you got it specifies that you are using bun v1.1.17 when the version should be v1.2.21 and above (as specified in de package.json for the type of bun (@types/bun), but itself is not mentioned in the package.json as it is not required to use this package)

maybe running bun upgrade or redownloading bun with a specific version as described here could help you fix this

@orimay
Copy link
Contributor Author

orimay commented Nov 20, 2025

Hey @orimay looking through the error that you got it specifies that you are using bun v1.1.17 when the version should be v1.2.21 and above (as specified in de package.json for the type of bun (@types/bun), but itself is not mentioned in the package.json as it is not required to use this package)

maybe running bun upgrade or redownloading bun with a specific version as described here could help you fix this

Ahh, I see it now, thanks! I was looking here:
image

Maybe updating it would cause less confusion for other people like me? :)

@orimay
Copy link
Contributor Author

orimay commented Nov 20, 2025

And it seems all the tests are passing

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