Uploaded image for project: 'Realm JavaScript SDK'
  1. Realm JavaScript SDK
  2. RJS-1246

Realm Web + Vue: Reactivity breaks log-in

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None

      Goals

      Use Realm Web with Vue.js v4 (and its @vue/reactility package).

      Expected Results

      Wrapping a Realm.App instance the reactive function shouldn't produce any unexpected results.

      Alternatively we need to document that users of Realm JS + Vue need to wrap Realm.App instances in `shallowReactive` before storing the instance in a store (making it reactive) or simply store the id of the App and use the Realm.App.get static method to avoid modified App instances.

      Actual Results

      An error is thrown when the App is wrapped as reactive and the logIn method is called:
      > The user was never logged into this app

      Steps to Reproduce & Code Sample

      Unable to find source-code formatter for language: typescript. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      import { reactive } from "@vue/reactivity";
      import { Credentials } from "realm-web";
      
      import { createApp } from "../utils";
      
      describe("Vue integration", () => {
          it("authenticates", async () => {
              const app = createApp();
              const reactiveApp = reactive(app);
              const credentials = Credentials.anonymous();
              const user = await reactiveApp.logIn(credentials);
              console.log(user);
          });
      });
      

      Version of Realm and Tooling

      • Realm Web SDK Version: v1.3.0

            Assignee:
            Unassigned Unassigned
            Reporter:
            kraen.hansen@mongodb.com Kræn Hansen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: