qishibo/AnotherRedisDesktopManager · error

Raw content is an object, but now parse object failed: ${e.m

Error message

Raw content is an object, but now parse object failed: ${e.message}

What it means

Element UI toast (6s duration) shown when re-encoding an edited msgpack value: the raw content from the editor is expected to be JSON (because the original decoded value was an object, not a string), and JSONbig.parse(content) throws. JSONbig is used to preserve big integers exactly; a syntax error in the edited JSON text aborts before @msgpack/msgpack's encode() runs, and getContent() returns false to block the write.

Source

Thrown at src/components/viewers/ViewerMsgpack.vue:34

    newContent() {
      try {
        return decode(this.content);
      } catch (e) {
        return this.$t('message.msgpack_format_failed');
      }
    },
  },
  methods: {
    getContent() {
      let content = this.$refs.editor.getRawContent();

      // raw content is an object
      if (typeof this.newContent !== 'string') {
        try {
          content = JSONbig.parse(content);
        } catch (e) {
          // object parse failed
          this.$message.error({
            message: `Raw content is an object, but now parse object failed: ${e.message}`,
            duration: 6000,
          });

          return false;
        }
      }

      // encode returns Uint8Array
      return Buffer.from(encode(content));
    },
    copyContent() {
      const content = decode(this.content);
      return (typeof content === 'object') ? JSONbig.stringify(content) : content;
    },
  },
};
</script>

View on GitHub (pinned to c149855106)

Solutions

  1. Correct the JSON syntax error and save again
  2. Run the editor's format/pretty-print action to pinpoint the syntax error location
  3. Validate externally (jq or a JSON linter) then paste back
  4. Improvement: include e.message (JSONbig reports position) in the toast to locate the error

Example fix

// before
this.$message.error({
  message: `Raw content is an object, but now parse object failed: ${e.message}`,
  duration: 6000,
});

// after
// surface position clearly
this.$message.error({
  message: `Invalid JSON in editor: ${e.message}`,
  duration: 6000,
});
Defensive patterns

Strategy: try-catch

Validate before calling

// validate before encode
try {
  JSONbig.parse(this.$refs.editor.getRawContent());
} catch (e) {
  this.$message.error(`Invalid JSON: ${e.message}`);
  return;
}

Type guard

const isParsableJSONbig = (s) => {
  try { JSONbig.parse(s); return true; } catch { return false; }
};

Try / catch

try {\n  content = JSONbig.parse(content);\n} catch (e) {\n  this.$message.error({ message: `Raw content is an object, but now parse object failed: ${e.message}`, duration: 6000 });\n  return false; // block the write, preserve editor contents\n}

Prevention

When it happens

Trigger: Opening a msgpack-encoded Redis key whose decoded value is an object, editing the JSON in the editor, introducing a syntax error (trailing comma, missing quote, unbalanced brace), then saving; pasting non-JSON text into the editor; truncating the JSON mid-edit and submitting.

Common situations: Hand-editing nested msgpack documents; values with very large int64 fields are fine (JSONbig keeps precision) but relaxed JSON (comments, single quotes) is not; collaborative edits pasted from notes apps that mangle quotes.

Related errors


AI-assisted analysis of qishibo/AnotherRedisDesktopManager@c149855106 (2026-08-22). Data as JSON: /api/errors/5aa4010bf775ae3b. Report an issue: GitHub.