Closed tw1t611 closed 1 month ago
Faced the same issue using surrealdb version 1.3.1 and js sdk >= 1.0.0
Original post : Discord post
Solution : Use a version of surrealdb >= 1.4.2
Discussed it on discord and didn't put an issue here, but here's the response I got :
A version check has been added but is not in the beta releases yet @kearfy
Related PR :
As @miisteur974 kindly pointed out, the minimum required version for the 1.0.0 version of this library is SurrealDB 1.4.2. I'll be releasing a new beta in a couple minutes likely, that should prevent any confusion in the future. Thanks!
Describe the bug
I cannot create a record using node 20, a websocket connection and the latest version of surrealdb.js.
The same code works with version 0.11.0.
Steps to reproduce
const endpoint = "ws://127.0.0.1:5000/rpc"; const namespace = "ns"; const database = "db"; const username = "root"; const password = "surrealdb";
export const surreal = async () => { try { const db = new Surreal(); await db.connect(endpoint, { namespace, database, auth: { namespace, database, username, password, }, }); return db; } catch (err) { console.error(err); } };
Expected behaviour
Should not throw an error.^^
SurrealDB version
SurrealDB command-line interface and server 1.2.1 for macos on aarch64
SurrealDB.js version
1.0.0-beta.6
Contact Details
No response
Is there an existing issue for this?
Code of Conduct