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

Bug: node_js_1.default is not a constructor at SurrealSocket.open #224

Open
2 tasks done
bawas opened this issue Apr 9, 2024 · 1 comment
Open
2 tasks done

Bug: node_js_1.default is not a constructor at SurrealSocket.open #224

bawas opened this issue Apr 9, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@bawas
Copy link

bawas commented Apr 9, 2024

Describe the bug

try to connect with websocket inside a serverless framework lambda with nodejs.16x as runtime

error: TypeError: node_js_1.default is not a constructor
      at SurrealSocket.open (/var/task/node_modules/surrealdb.js/script/library/SurrealSocket.js:92:20)

i found a issue similar to this, but i dont have the dependencies which apparently was generating the error. Before i was using the SurrealDB.js with version 0.5.0 and it was working fine

Steps to reproduce

import { Surreal } from 'surrealdb.js';

const db = new Surreal();

// this line throws an error
await surrealDb.connect(process.env.SURREAL_URL, {
      auth: {
        username: process.env.SURREAL_USERNAME,
        password: process.env.SURREAL_PASSWORD,
      },
      namespace: process.env.SURREAL_NAMESPACE,
      database: process.env.SURREAL_DBNAME,
    });

Expected behaviour

The connection should initialize and not throw an error

SurrealDB version

v1.2.1

SurrealDB.js version

0.11.0

Contact Details

tharris@cloudcar.cl

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@bawas bawas added the bug Something isn't working label Apr 9, 2024
@macjuul
Copy link
Contributor

macjuul commented Apr 19, 2024

I can't reproduce this issue myself when running surrealdb.js directly in node.js 16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants