Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Reaction
✓ import { Reaction } from 'ord-schema-protobufjs'
✗ const { Reaction } = require('ord-schema-protobufjs')
Package uses protobuf.js static code generation; ESM import is preferred in Node 12+.
Compound
✓ import { Compound } from 'ord-schema-protobufjs'
✗ import * as ord from 'ord-schema-protobufjs'; const Compound = ord.Compound
Named exports are available directly; no need for namespace import.
ordSchema
✓ import ordSchema from 'ord-schema-protobufjs'
✗ const ordSchema = require('ord-schema-protobufjs')
Default export gives access to the root protobuf object; use for loading descriptors or custom usage.
Creates a simple reaction with SMILES identifiers, conditions, and demonstrates encode/decode round-trip.
import { Reaction, Compound } from 'ord-schema-protobufjs';
// Create a new Reaction message
const reaction = Reaction.create({
identifiers: [{ value: 'OCCO', type: Compound.CompoundIdentifier.SMILES }],
inputs: {
'substrate': {
components: [{
substance: {
identifiers: [{ value: 'CCO', type: Compound.CompoundIdentifier.SMILES }]
}
}]
}
},
conditions: {
temperature: { setpoint: { value: 80, units: 'CELSIUS' } },
time: { duration: { value: 2, units: 'HOUR' } }
}
});
// Verify the message
const err = Reaction.verify(reaction);
if (err) throw Error(err);
// Encode to binary
const buffer = Reaction.encode(reaction).finish();
console.log('Encoded length:', buffer.length);
// Decode back
const decoded = Reaction.decode(buffer);
console.log('Decoded reaction temperature:', decoded.conditions?.temperature?.setpoint?.value);
Errors
Common errors & fixes
Error: Invalid type: expected Message, got Object
Passing a plain JavaScript object to a method that expects a protobuf message instance.
fixUse the .create() static method to construct the message: Reaction.create(obj) instead of plain obj.
TypeError: Reaction.verify is not a function
Importing the package incorrectly (e.g., using namespace import instead of named import).
fixUse named import: import { Reaction } from 'ord-schema-protobufjs'. Error: Value for field 'units' is not a valid enum value.
Using a string that does not match the exact enum value (e.g., 'CELSIUS' vs 'CELCIUS' typo).
fixUse the numeric enum value from the generated constants, e.g., Temperature.TemperatureUnit.CELSIUS.
Module not found: Can't resolve 'ord-schema-protobufjs'
Missing dependency or incorrect npm install.
fixRun: npm install ord-schema-protobufjs --save
Audit
Dependencies
protobufjsrequiredRuntime dependency for protobuf message serialization/deserialization
longoptionalNeeded for 64-bit integer support in protobuf.js in certain environments