objectbox / objectbox/objectbox-dart

RangeError (byteOffset): Index out of range: index should be less than 2048: 2048

Open
#786 4 comments 0 reactions 1 assignee View on GitHub

@greenrobot-team is already working on this.

Since Feb 11, 2026.

bug
Dominant language
Dart
Stars
1.2k
Forks
162
Avg merge
15m
Merged PRs (30d)
1

Description

I have Map<String, dynamic> flex property in the entity schema.

When I'm trying to save ~30 UUIDs in this flex field, I'm getting these error logs:

RangeError (byteOffset): Index out of range: index should be less than 2048: 2048
flutter: #0      _byteDataByteOffsetCheck (dart:typed_data-patch/typed_data_patch.dart:5419:5)
typed_data_patch.dart:5419
#1      _ByteDataView.setUint8 (dart:typed_data-patch/typed_data_patch.dart:5115:18)
typed_data_patch.dart:5115
#2      Builder._pushUInt (package:flat_buffers/src/builder.dart:533:17)
builder.dart:533
#3      Builder._writeUInt (package:flat_buffers/src/builder.dart:495:5)
builder.dart:495
#4      Builder._createVector (package:flat_buffers/src/builder.dart:368:9)
builder.dart:368
#5      Builder._endMap (package:flat_buffers/src/builder.dart:441:17)
builder.dart:441
#6      Builder._sortKeysAndEndMap (package:flat_buffers/src/builder.dart:424:5)
builder.dart:424
#7      Builder.end (package:flat_buffers/src/builder.dart:246:7)
builder.dart:246
#8      Builder._add (package:flat_buffers/src/builder.dart:62:7)
builder.dart:62
#9      Builder.buildFromObject (package:flat_buffers/src/builder.dart:30:13)
builder.dart:30
#10     toFlexBuffer (package:objectbox/src/native/bindings/flexbuffers.dart:13:31)
flexbuffers.dart:13
#11     getObjectBoxModel.<anonymous closure> (package:ssadavoca/infrastructure/db/objectbox.g.dart:2079:33)
objectbox.g.dart:2079
#12     Box._put (package:objectbox/src/native/box.dart:25<…>

This is causing severe problems in my production app. If there was a hard size limit on the flex property, the documentation should have stated this.

Is it correct that the flex field has a 2048B size limit? Or is it configurable? Any help would be greatly appreciated.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.