Open var-che opened 6 months ago
Instantiating Surreal wasm within the Reactjs part of the Nextjs project causes an error:
Module build failed: UnhandledSchemeError: Reading from "node:crypto" is not handled by plugins (Unhandled scheme).
Create a NextJs app and instantiate the Surreal database within the page.tsx.
page.tsx
"use client" import {Surreal} from 'surrealdb.wasm'; export default function NameDoesntMatter() { prepareSurreal(); return(<p>demo</p>); } async function prepareSurreal() { let db = new Surreal(); try { await db.connect('memory'); await db.use({database: "db", namespace: "ns"}); } catch (error) { console.log(error) } }
I expect it to instantiate the database so that I can use in-memory one, on the browser.
I expect to be able to create a new user and query that user back.
surrealdb wasm 0.8.0 ubuntu 22.04.3 LST
No response
any workarround for this problem ?
Describe the bug
Instantiating Surreal wasm within the Reactjs part of the Nextjs project causes an error:
Module build failed: UnhandledSchemeError: Reading from "node:crypto" is not handled by plugins (Unhandled scheme).
Steps to reproduce
Create a NextJs app and instantiate the Surreal database within the
page.tsx
.Expected behaviour
I expect it to instantiate the database so that I can use in-memory one, on the browser.
I expect to be able to create a new user and query that user back.
SurrealDB version
surrealdb wasm 0.8.0 ubuntu 22.04.3 LST
Contact Details
No response
Is there an existing issue for this?
Code of Conduct