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 PHP-serialized value: the decoded value was an object (typeof this.newContent !== 'string'), so on save the edited text must parse back as JSON before node-serialize's serialize() can rebuild the PHP serialize() string. When JSON.parse(content) throws, the write is aborted with this message and getContent() returns false.

Source

Thrown at src/components/viewers/ViewerPHPSerialize.vue:43

        }

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

      // raw content is an object
      if (typeof this.newContent !== 'string') {
        try {
          content = JSON.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;
        }
      }

      return serialize(content);
    },
  },
};
</script>

View on GitHub (pinned to c149855106)

Solutions

  1. Fix the JSON syntax error in the editor and save again
  2. Use the editor's JSON format action to locate the syntax error
  3. If the original value was a plain string, note this path only runs when newContent is an object — string values skip JSON parsing
  4. Enhancement: append e.message (JSON.parse reports position) to the toast

Example fix

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

// after
this.$message.error({
  message: `Edited JSON is invalid: ${e.message}`,
  duration: 6000,
});
Defensive patterns

Strategy: try-catch

Validate before calling

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

Type guard

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

Try / catch

try {\n  content = JSON.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; // abort serialize(), keep editor state\n}

Prevention

When it happens

Trigger: Opening a PHP-serialized Redis key (session data, laravel/symfony cache written by php serialize()), editing the JSON representation in the viewer, breaking JSON syntax (missing comma, single quotes, trailing comma), then saving.

Common situations: Editing PHP session arrays by hand; mixed content where strings contain quotes that break escaping when edited; pasting from PHP var_dump output which is not valid JSON.

Related errors


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