Closed limcheekin closed 6 months ago
I may be missing something. Perhaps @kearfy might be able to understand the issue better but I cannot recreate it. With the following changeset, for example, I can see the record created in the console.
diff --git a/index.html b/index.html
index d13024a..0f59495 100644
--- a/index.html
+++ b/index.html
@@ -11,6 +11,11 @@
if (typeof window !== 'undefined') {
window.Surreal = Surreal;
}
+ const db = new Surreal();
+ await db.connect("memory");
+ await db.use({ namespace: "test", database: "test" });
+ const created = await db.create("foo");
+ console.log(created);
</script>
</body>
</html>
How are you actually performing your step 2? What does your index.html
look like after that step?
I typically don't do step 2 in index.html. I just do step 1 and 3, and then do step 2 in the console itself.
@rushmorem Thanks for quick reponse. Sorry for slow response as I'm just back from vacation 2 days ago.
Step 2 is needed to run the code in the index.html. The code look exactly like the one you shared above.
By the way, I use the following command to build the wasm module:
wasm-pack build --release --target web --out-name index --out-dir ../assets/wasm/surrealdb --no-default-features --features protocol-ws,protocol-http,kv-indxdb,kv-mem,rustls
The same command worked with 0.7.0 release. Did I missed anything?
Alright.
It works if I build the surrealdb.wasm with the following command:
npm run build
Describe the bug
I added the following code to the index.html:
The Chrome browser console throw the following error:
Appreciate the effort to fix the Development Server code as it is important to developers to learn about surrealdb.wasm.
Steps to reproduce
npm run serve
, you first need to build the wasm module before this step.const db = new Surreal();
to index.html.Expected behaviour
No error reported. The
db
should instantiate successfully.SurrealDB version
1.2.0
Contact Details
No response
Is there an existing issue for this?
Code of Conduct