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

Realm 12.0.0 migration : had to downgrade typescript to 4.8.4 (from 5)

      How frequently does the bug occur?

      Always

      Description

      I migrated from Realm 11 to 12 and had to downgrade Typescript from 5 to 4.8.4 because of OrderedCollection implementation of Omit<ReadonlyArray<T>, "entries"> is incomplete (from what I understand).

      I'm not using babel, don't know if it supposed to make a difference. This are the only depencies I have.

      [I'm not really a node expert :)]

        "dependencies": {
          "realm": "^12.0.0"
        },
        "devDependencies": {
          "@types/node": "^20.5.7",
          "typescript": "^4.8.4"
        }
      
      {
        // https://www.typescriptlang.org/tsconfig#compilerOptions
        "compilerOptions": {
          "esModuleInterop": true,
          "lib": ["es2020"],
          "module": "es2022",
          "preserveConstEnums": true,
          "moduleResolution": "node",
          "strict": true,
          "sourceMap": true,
          "target": "es2022",
          "types": ["node"],
          "outDir": "dist"
        },
        "include": ["src/**/*"],
        "exclude": ["node_modules"]
      }
      

      Stacktrace & log output

      Unable to find source-code formatter for language: shell. 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
      node_modules/realm/dist/bundle.d.ts:424:24 - error TS2420: Class 'OrderedCollection<T, EntryType>' incorrectly implements interface 'Omit<readonly T[], "entries">'.
        Property '[SymbolConstructor.unscopables]' is missing in type 'OrderedCollection<T, EntryType>' but required in type 'Omit<readonly T[], "entries">'.
      
      424 declare abstract class OrderedCollection<T = unknown, EntryType extends [unknown, unknown] = [number, T]> extends Collection<number, T, EntryType, T, CollectionChangeCallback<T, EntryType>> implements Omit<ReadonlyArray<T>, "entries"> {
                                 ~~~~~~~~~~~~~~~~~
      
        node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:107:14
          107     readonly [Symbol.unscopables]: {
                           ~~~~~~~~~~~~~~~~~~~~
          '[SymbolConstructor.unscopables]' is declared here.
      

      Can you reproduce the bug?

      Always

      Reproduction Steps

      I can share code privately if it helps but I would say that upgrading typescript would show the issue.

      Version

      12.0.0

      What services are you using?

      Both Atlas Device Sync and Atlas App Services

      Are you using encryption?

      No

      Platform OS and version(s)

      mac 0S

      Build environment

      Which debugger for React Native: ..

      Cocoapods version

      No response

            Assignee:
            kenneth.geisshirt@mongodb.com Kenneth Geisshirt
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: