-
Notifications
You must be signed in to change notification settings - Fork 172
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
The @arizeai/openinference-genai package fails to load when imported through @mastra/arize in a CommonJS environment. Node.js throws an error: "No 'exports' main defined" because the package only defines ESM (import) exports in its package.json, but no CommonJS (require) exports.
To Reproduce
- Install
@mastra/arize(version^0.1.1) which depends on@arizeai/openinference-genai - Import
ArizeExporterfrom@mastra/arizein a TypeScript file - Run the application using
ts-node-dev(which compiles to CommonJS by default) - The application will crash with the following error:
Error: No "exports" main defined in /path/to/node_modules/@arizeai/openinference-genai/package.json
at exportsNotFound (node:internal/modules/esm/resolve:314:10)
at packageExportsResolve (node:internal/modules/esm/resolve:604:13)
at resolveExports (node:internal/modules/cjs/loader:657:36)
at Function._findPath (node:internal/modules/cjs/loader:749:31)
at Function._resolveFilename (node:internal/modules/cjs/loader:1387:27)
...
Expected behavior
The @arizeai/openinference-genai package should provide both ESM and CommonJS exports in its package.json to support both module systems, or at minimum provide a fallback main field for CommonJS compatibility.
Screenshots
N/A
Desktop (please complete the following information):
- OS: macOS (darwin 24.6.0)
- Node.js Version: 22.x
- Package Version:
@arizeai/[email protected]
Additional context
The @arizeai/openinference-genai package.json currently has:
"type": "module"(ESM-only)exportsfield with only"import"conditions, no"require"conditions- No
mainfield for CommonJS fallback
This causes issues when:
- The consuming application uses CommonJS (via
ts-node-devor compiled TypeScript) - The package is imported transitively through
@mastra/arize
dosubot
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
No status