Skip to content

If this throws, you likely found a bug #8607

@danddinh

Description

@danddinh

RxDB shows this message: If this throws, you likely found a bug

Here the full error log in devtools console:

ERROR RxError (DM4): 

Error message: Migration errored
Error code: DM4
Cause: An error occurred during migration.
Fix: Check the error details.
Docs: https://rxdb.info/migration-schema.html?console=errors&code=DM4
Find out more about this error here: https://rxdb.info/errors.html?console=errors#DM4 

--------------------
Parameters:
collection: "pinnedApps"
error: {
  "name": "RxError (SNH)",
  "message": "\n\nError message: This should never happen\nError code: SNH\nCause: Should never be thrown. This error code is used for internal things like null-checks etc.\nFix: If this throws, you likely found a bug and should make a PR with a test case to the RxDB repo, so we can reproduce it.\nDocs: https://rxdb.info/contribution.html\nFind out more about this error here: https://rxdb.info/errors.html?console=errors#SNH \n\n--------------------\nParameters:\nname: \"non conflict error\"\nerror: {\n  \"status\": 422,\n  \"isError\": true,\n  \"documentId\": \"claude.ai\",\n  \"validationErrors\": [\n    {\n      \"instancePath\": \"/icon\",\n      \"schemaPath\": \"#/properties/icon/type\",\n      \"keyword\": \"type\",\n      \"params\": {\n        \"type\": \"string\"\n      },\n      \"message\": \"must be string\"\n    }\n  ],\n  \"schema\": {\n    \"additionalProperties\": false,\n    \"encrypted\": [],\n    \"indexes\": [\n      [\n        \"_deleted\",\n        \"name\",\n        \"id\"\n      ],\n      [\n        \"_deleted\",\n        \"url\",\n        \"id\"\n      ],\n      [\n        \"_meta.lwt\",\n        \"id\"\n      ]\n    ],\n    \"keyCompression\": false,\n    \"primaryKey\": \"id\",\n    \"properties\": {\n      \"_attachments\": {\n        \"type\": \"object\"\n      },\n      \"_deleted\": {\n        \"type\": \"boolean\"\n      },\n      \"_meta\": {\n        \"additionalProperties\": true,\n        \"properties\": {\n          \"lwt\": {\n            \"maximum\": 1000000000000000,\n            \"minimum\": 1,\n            \"multipleOf\": 0.01,\n            \"type\": \"number\"\n          }\n        },\n        \"required\": [\n          \"lwt\"\n        ],\n        \"type\": \"object\"\n      },\n      \"_rev\": {\n        \"minLength\": 1,\n        \"type\": \"string\"\n      },\n      \"custom\": {\n        \"type\": \"boolean\"\n      },\n      \"description\": {\n        \"maxLength\": 1000,\n        \"type\": \"string\"\n      },\n      \"icon\": {\n        \"maxLength\": 1000,\n        \"type\": \"string\"\n      },\n      \"id\": {\n        \"maxLength\": 100,\n        \"type\": \"string\"\n      },\n      \"integrated\": {\n        \"type\": \"boolean\"\n      },\n      \"internal\": {\n        \"type\": \"boolean\"\n      },\n      \"name\": {\n        \"maxLength\": 100,\n        \"type\": \"string\"\n      },\n      \"tags\": {\n        \"items\": {\n          \"maxLength\": 100,\n          \"type\": \"string\"\n        },\n        \"type\": \"array\"\n      },\n      \"tokens\": {\n        \"items\": {\n          \"maxLength\": 100,\n          \"type\": \"string\"\n        },\n        \"type\": \"array\"\n      },\n      \"url\": {\n        \"maxLength\": 1000,\n        \"type\": \"string\"\n      }\n    },\n    \"required\": [\n      \"name\",\n      \"url\",\n      \"_deleted\",\n      \"_rev\",\n      \"_meta\",\n      \"_attachments\",\n      \"id\"\n    ],\n    \"type\": \"object\",\n    \"version\": 3\n  },\n  \"writeRow\": {\n    \"document\": {\n      \"name\": \"Claude\",\n      \"icon\": null,\n      \"description\": \"AI for coding focus\",\n      \"id\": \"claude.ai\",\n      \"url\": \"https://claude.ai\",\n      \"tags\": [\n        \"online\",\n        \"coding\",\n        \"free\",\n        \"ai\",\n        \"free\"\n      ],\n      \"integrated\": false,\n      \"internal\": false,\n      \"_rev\": \"1-wwrpkjooqk\",\n      \"_attachments\": {},\n      \"_meta\": {\n        \"lwt\": 1780323694519.01\n      },\n      \"_deleted\": false\n    }\n  },\n  \"context\": \"replication-master-write\"\n}\n",
  "rxdb": true,
  "parameters": {
    "name": "non conflict error",
    "error": {
      "status": 422,
      "isError": true,
      "documentId": "claude.ai",
      "validationErrors": [
        {
          "instancePath": "/icon",
          "schemaPath": "#/properties/icon/type",
          "keyword": "type",
          "params": {
            "type": "string"
          },
          "message": "must be string"
        }
      ],
      "schema": {
        "additionalProperties": false,
        "encrypted": [],
        "indexes": [
          [
            "_deleted",
            "name",
            "id"
          ],
          [
            "_deleted",
            "url",
            "id"
          ],
          [
            "_meta.lwt",
            "id"
          ]
        ],
        "keyCompression": false,
        "primaryKey": "id",
        "properties": {
          "_attachments": {
            "type": "object"
          },
          "_deleted": {
            "type": "boolean"
          },
          "_meta": {
            "additionalProperties": true,
            "properties": {
              "lwt": {
                "maximum": 1000000000000000,
                "minimum": 1,
                "multipleOf": 0.01,
                "type": "number"
              }
            },
            "required": [
              "lwt"
            ],
            "type": "object"
          },
          "_rev": {
            "minLength": 1,
            "type": "string"
          },
          "custom": {
            "type": "boolean"
          },
          "description": {
            "maxLength": 1000,
            "type": "string"
          },
          "icon": {
            "maxLength": 1000,
            "type": "string"
          },
          "id": {
            "maxLength": 100,
            "type": "string"
          },
          "integrated": {
            "type": "boolean"
          },
          "internal": {
            "type": "boolean"
          },
          "name": {
            "maxLength": 100,
            "type": "string"
          },
          "tags": {
            "items": {
              "maxLength": 100,
              "type": "string"
            },
            "type": "array"
          },
          "tokens": {
            "items": {
              "maxLength": 100,
              "type": "string"
            },
            "type": "array"
          },
          "url": {
            "maxLength": 1000,
            "type": "string"
          }
        },
        "required": [
          "name",
          "url",
          "_deleted",
          "_rev",
          "_meta",
          "_attachments",
          "id"
        ],
        "type": "object",
        "version": 3
      },
      "writeRow": {
        "document": {
          "name": "Claude",
          "icon": null,
          "description": "AI for coding focus",
          "id": "claude.ai",
          "url": "https://claude.ai",
          "tags": [
            "online",
            "coding",
            "free",
            "ai",
            "free"
          ],
          "integrated": false,
          "internal": false,
          "_rev": "1-wwrpkjooqk",
          "_attachments": {},
          "_meta": {
            "lwt": 1780323694519.01
          },
          "_deleted": false
        }
      },
      "context": "replication-master-write"
    }
  },
  "extensions": null,
  "code": "SNH",
  "url": "https://rxdb.info/errors.html?console=errors#SNH",
  "stack": "RxError (SNH):  \n  \n Error message: This should never happen \n Error code: SNH \n Cause: Should never be thrown. This error code is used for internal things like null-checks etc. \n Fix: If this throws, you likely found a bug and should make a PR with a test case to the RxDB repo, so we can reproduce it. \n Docs: https://rxdb.info/contribution.html \n Find out more about this error here: https://rxdb.info/errors.html?console=errors#SNH  \n  \n -------------------- \n Parameters: \n name: \"non conflict error\" \n error: { \n   \"status\": 422, \n   \"isError\": true, \n   \"documentId\": \"claude.ai\", \n   \"validationErrors\": [ \n     { \n       \"instancePath\": \"/icon\", \n       \"schemaPath\": \"#/properties/icon/type\", \n       \"keyword\": \"type\", \n       \"params\": { \n         \"type\": \"string\" \n       }, \n       \"message\": \"must be string\" \n     } \n   ], \n   \"schema\": { \n     \"additionalProperties\": false, \n     \"encrypted\": [], \n     \"indexes\": [ \n       [ \n         \"_deleted\", \n         \"name\", \n         \"id\" \n       ], \n       [ \n         \"_deleted\", \n         \"url\", \n         \"id\" \n       ], \n       [ \n         \"_meta.lwt\", \n         \"id\" \n       ] \n     ], \n     \"keyCompression\": false, \n     \"primaryKey\": \"id\", \n     \"properties\": { \n       \"_attachments\": { \n         \"type\": \"object\" \n       }, \n       \"_deleted\": { \n         \"type\": \"boolean\" \n       }, \n       \"_meta\": { \n         \"additionalProperties\": true, \n         \"properties\": { \n           \"lwt\": { \n             \"maximum\": 1000000000000000, \n             \"minimum\": 1, \n             \"multipleOf\": 0.01, \n             \"type\": \"number\" \n           } \n         }, \n         \"required\": [ \n           \"lwt\" \n         ], \n         \"type\": \"object\" \n       }, \n       \"_rev\": { \n         \"minLength\": 1, \n         \"type\": \"string\" \n       }, \n       \"custom\": { \n         \"type\": \"boolean\" \n       }, \n       \"description\": { \n         \"maxLength\": 1000, \n         \"type\": \"string\" \n       }, \n       \"icon\": { \n         \"maxLength\": 1000, \n         \"type\": \"string\" \n       }, \n       \"id\": { \n         \"maxLength\": 100, \n         \"type\": \"string\" \n       }, \n       \"integrated\": { \n         \"type\": \"boolean\" \n       }, \n       \"internal\": { \n         \"type\": \"boolean\" \n       }, \n       \"name\": { \n         \"maxLength\": 100, \n         \"type\": \"string\" \n       }, \n       \"tags\": { \n         \"items\": { \n           \"maxLength\": 100, \n           \"type\": \"string\" \n         }, \n         \"type\": \"array\" \n       }, \n       \"tokens\": { \n         \"items\": { \n           \"maxLength\": 100, \n           \"type\": \"string\" \n         }, \n         \"type\": \"array\" \n       }, \n       \"url\": { \n         \"maxLength\": 1000, \n         \"type\": \"string\" \n       } \n     }, \n     \"required\": [ \n       \"name\", \n       \"url\", \n       \"_deleted\", \n       \"_rev\", \n       \"_meta\", \n       \"_attachments\", \n       \"id\" \n     ], \n     \"type\": \"object\", \n     \"version\": 3 \n   }, \n   \"writeRow\": { \n     \"document\": { \n       \"name\": \"Claude\", \n       \"icon\": null, \n       \"description\": \"AI for coding focus\", \n       \"id\": \"claude.ai\", \n       \"url\": \"https://claude.ai\", \n       \"tags\": [ \n         \"online\", \n         \"coding\", \n         \"free\", \n         \"ai\", \n         \"free\" \n       ], \n       \"integrated\": false, \n       \"internal\": false, \n       \"_rev\": \"1-wwrpkjooqk\", \n       \"_attachments\": {}, \n       \"_meta\": { \n         \"lwt\": 1780323694519.01 \n       }, \n       \"_deleted\": false \n     } \n   }, \n   \"context\": \"replication-master-write\" \n } \n  \n     at newRxError (https://localhost:4200/@fs/C:/Aimav/aimav-w/.angular/cache/21.2.13/aimav-w/vite/deps/chunk-BGJCLMQS.js?v=58a40309:239:10) \n     at https://localhost:4200/@fs/C:/Aimav/aimav-w/.angular/cache/21.2.13/aimav-w/vite/deps/chunk-UPFDOVNJ.js?v=58a40309:1120:21 \n     at Array.forEach (<anonymous>) \n     at Object.<anonymous> (https://localhost:4200/@fs/C:/Aimav/aimav-w/.angular/cache/21.2.13/aimav-w/vite/deps/chunk-UPFDOVNJ.js?v=58a40309:1118:24) \n     at Generator.next (<anonymous>) \n     at fulfilled (https://localhost:4200/@fs/C:/Aimav/aimav-w/.angular/cache/21.2.13/aimav-w/vite/deps/chunk-RSHFFPKK.js?v=58a40309:73:24)"
}

    at newRxError (rx-error.js:105:10)
    at RxMigrationState2.<anonymous> (rx-migration-state.js:408:13)
    at Generator.next (<anonymous>)
    at fulfilled (chunk-RSHFFPKK.js:73:24)
handleError @ _effect-chunk2.mjs:2601
(anonymous) @ _effect-chunk2.mjs:2617
runOutsideAngular @ _effect-chunk2.mjs:2576
(anonymous) @ _effect-chunk2.mjs:2610
rejectionListener @ _effect-chunk2.mjs:2646
chunk-RSHFFPKK.js:73 ERROR Error: strict mode: required property "year" is not defined at "#" (strictRequired)
    at checkStrictMode (util.js:174:15)
    at Object.code (required.js:33:32)
    at keywordCode (index.js:464:13)
    at index.js:222:17
    at CodeGen.code (index.js:439:13)
    at CodeGen.block (index.js:568:18)
    at iterateKeywords (index.js:219:9)
    at groupKeywords (index.js:200:13)
    at index.js:192:13
    at CodeGen.code (index.js:439:13)
handleError @ _effect-chunk2.mjs:2601
(anonymous) @ _effect-chunk2.mjs:2617
runOutsideAngular @ _effect-chunk2.mjs:2576
(anonymous) @ _effect-chunk2.mjs:2610
errorListener @ _effect-chunk2.mjs:2651
requestIdleCallback
requestIdleCallbackIfAvailable @ utils-promise.js:120
(anonymous) @ plugin-helpers.js:53
fulfilled @ chunk-RSHFFPKK.js:73
Promise.then
step @ chunk-RSHFFPKK.js:85
(anonymous) @ chunk-RSHFFPKK.js:86
__async @ chunk-RSHFFPKK.js:70
createStorageInstance @ plugin-helpers.js:42
(anonymous) @ rx-migration-state.js:85
fulfilled @ chunk-RSHFFPKK.js:73
Promise.then
step @ chunk-RSHFFPKK.js:85
fulfilled @ chunk-RSHFFPKK.js:73
Promise.then
step @ chunk-RSHFFPKK.js:85
fulfilled @ chunk-RSHFFPKK.js:73
Promise.then
step @ chunk-RSHFFPKK.js:85
(anonymous) @ chunk-RSHFFPKK.js:86
__async @ chunk-RSHFFPKK.js:70
startMigration @ rx-migration-state.js:46
(anonymous) @ rx-migration-state.js:393
(anonymous) @ chunk-RSHFFPKK.js:86
__async @ chunk-RSHFFPKK.js:70
migratePromise @ rx-migration-state.js:392
migratePromise @ rx-collection.js:176
(anonymous) @ rx-collection.js:948
fulfilled @ chunk-RSHFFPKK.js:73
Promise.then
step @ chunk-RSHFFPKK.js:85
(anonymous) @ chunk-RSHFFPKK.js:86
__async @ chunk-RSHFFPKK.js:70
createRxCollection @ rx-collection.js:900
(anonymous) @ rx-database.js:347
fulfilled @ chunk-RSHFFPKK.js:73
Promise.then
step @ chunk-RSHFFPKK.js:85
(anonymous) @ chunk-RSHFFPKK.js:86
__async @ chunk-RSHFFPKK.js:70
(anonymous) @ rx-database.js:344
(anonymous) @ rx-database.js:344
fulfilled @ chunk-RSHFFPKK.js:73
Promise.then
step @ chunk-RSHFFPKK.js:85
fulfilled @ chunk-RSHFFPKK.js:73
Promise.then
step @ chunk-RSHFFPKK.js:85
fulfilled @ chunk-RSHFFPKK.js:73
Promise.then
step @ chunk-RSHFFPKK.js:85
(anonymous) @ chunk-RSHFFPKK.js:86
__async @ chunk-RSHFFPKK.js:70
addCollections @ rx-database.js:220
(anonymous) @ app.ts:1080
fulfilled @ main.js:24
Promise.then
step @ main.js:36
(anonymous) @ main.js:37
__async @ main.js:21
ngOnInit @ app.ts:1066
callHookInternal @ _debug_node-chunk.mjs:555
callHook @ _debug_node-chunk.mjs:570
callHooks @ _debug_node-chunk.mjs:544
executeInitAndCheckHooks @ _debug_node-chunk.mjs:513
refreshView @ _debug_node-chunk.mjs:5802
detectChangesInView @ _debug_node-chunk.mjs:5930
detectChangesInViewWhileDirty @ _debug_node-chunk.mjs:5739
detectChangesInternal @ _debug_node-chunk.mjs:5728
synchronizeOnce @ _debug_node-chunk.mjs:12477
synchronize @ _debug_node-chunk.mjs:12451
tickImpl @ _debug_node-chunk.mjs:12426
_tick @ _debug_node-chunk.mjs:12414
tick @ _debug_node-chunk.mjs:12407
_loadComponent @ _debug_node-chunk.mjs:12521
(anonymous) @ _debug_node-chunk.mjs:12394
run @ _effect-chunk2.mjs:2570
bootstrapImpl @ _debug_node-chunk.mjs:12362
bootstrap @ _debug_node-chunk.mjs:12358
(anonymous) @ core.mjs:672
Promise.then
(anonymous) @ core.mjs:654
_callAndReportToErrorHandler @ core.mjs:700
(anonymous) @ core.mjs:649
run @ _effect-chunk2.mjs:2570
bootstrap @ core.mjs:613
internalCreateApplication @ core.mjs:2149
(anonymous) @ _browser-chunk.mjs:267
(anonymous) @ chunk-RSHFFPKK.js:86
__async @ chunk-RSHFFPKK.js:70
bootstrapApplication @ _browser-chunk.mjs:259
(anonymous) @ main.ts:8
2_effect-chunk2.mjs:2601 ERROR Error: RxStorageInstanceDexie is closed aimav-pinnedApps
    at ensureNotClosed (rx-storage-instance-dexie.js:219:11)
    at RxStorageInstanceDexie2.<anonymous> (rx-storage-instance-dexie.js:165:5)
    at Generator.next (<anonymous>)
    at chunk-RSHFFPKK.js:86:61
    at new Promise (<anonymous>)
    at __async (chunk-RSHFFPKK.js:70:10)
    at RxStorageInstanceDexie2.cleanup (rx-storage-instance-dexie.js:164:63)
    at rx-storage-helper.js:647:55
    at IdleQueue2.wrapCall (index.js:72:16)
    at RxDatabaseBase2.lockedRun (rx-database.js:372:27)
handleError @ _effect-chunk2.mjs:2601
(anonymous) @ _effect-chunk2.mjs:2617
runOutsideAngular @ _effect-chunk2.mjs:2576
(anonymous) @ _effect-chunk2.mjs:2610
rejectionListener @ _effect-chunk2.mjs:2646

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions