qishibo/AnotherRedisDesktopManager · error

Fail to load proto: ${e.message}

Error message

Fail to load proto: ${e.message}

What it means

Element UI toast shown when protobuf.load(paths) rejects while parsing the selected .proto file(s). protobufjs parses .proto grammar at runtime; it rejects with a tokenize/parse error (with filename, line, and column) for syntax errors, unresolved imports, or unreadable files. The catch also calls clearBinding(), so the failing key-to-proto profile is removed and must be reselected.

Source

Thrown at src/components/viewers/ViewerProtobuf.vue:196

        this.selectedType = this.types.length > 1 ? this.types[1] : 'Rawproto';

        // protobuf decode failed
        if (this.selectedType === 'Rawproto' || this.newContent === DECODE_FAILED) {
          // restore mode, clear binding
          // if (!persist) {
          //   this.clearBinding();
          // }
          return false;
        }

        // protobuf decode success
        if (persist) {
          this.persistBinding();
        }

        return true;
      }).catch((e) => {
        this.$message.error(`Fail to load proto: ${e.message}`);
        this.clearBinding();
        return false;
      }).finally(() => {
        // release bookmarks if exists
        release();
      });
    },
    persistBinding() {
      const redisKeyHex = this.keyHex;
      if (!redisKeyHex || !this.proto.length) {
        return;
      }

      storage.bindProtobufProfile(redisKeyHex, {
        name: this.proto.map(p => path.basename(p)).join(', '),
        paths: this.proto,
        bookmarks: this.bookmarks,
      });

View on GitHub (pinned to c149855106)

Solutions

  1. Read e.message — protobufjs reports file:line:column of the parse failure; fix that spot
  2. Ensure imported .proto files are included in the multi-selection (the dialog allows multiSelections)
  3. Run `protoc --proto_path=<dir> <file>.proto` locally to confirm the file is valid before selecting it
  4. After fixing, reselect the files to rebuild the binding (it was cleared)

Example fix

// before
}).catch((e) => {
  this.$message.error(`Fail to load proto: ${e.message}`);
  this.clearBinding();
  return false;
});

// after - longer duration so the file:line detail is readable
}).catch((e) => {
  this.$message.error({ message: `Fail to load proto: ${e.message}`, duration: 10000 });
  this.clearBinding();
  return false;
});
Defensive patterns

Strategy: try-catch

Validate before calling

// validate the proto compiles before binding it
// (run locally): protoc --proto_path=<dir> file.proto

Try / catch

protobuf.load(paths).then((root) => { ... })
  .catch((e) => {
    // e.message contains file:line:column of the syntax error
    this.$message.error({ message: `Fail to load proto: ${e.message}`, duration: 10000 });
    this.clearBinding();
    return false;
  });

Prevention

When it happens

Trigger: Selecting a .proto with a syntax error (missing semicolon, bad proto2/proto3 declaration); a file that imports another .proto not present in the selected set or its include paths; selecting a file that is actually protobuf source trimmed/corrupted (truncated download); permission errors reading the file.

Common situations: Editing proto files in another tool and saving mid-edit; protos that compile only with protoc -I include paths, since protobuf.load here gets bare file paths with no import roots; CR/LF or BOM issues in hand-made files; switching proto versions where syntax changed.

Related errors


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