P
Prisma5mo ago
Fresh

Prisma Optimize CommonJS Issue

See: https://discord.com/channels/937751382725886062/1146889757364850791/1392901347153678508 Really wanted to give optimize a shot, but running into issues getting it started. My package.json:
// deps:
// prisma
"@prisma/client": "^6.11.1",
"@prisma/extension-optimize": "^2.0.0",
"@prisma/instrumentation": "^6.11.1",
// otel
"@opentelemetry/api": "^1.9.0",
"@opentelemetry/exporter-logs-otlp-http": "^0.57.2",
"@opentelemetry/exporter-trace-otlp-http": "^0.57.2",
"@opentelemetry/instrumentation": "^0.57.2",
"@opentelemetry/resources": "^1.30.1",
"@opentelemetry/sdk-node": "^0.57.2",
"@opentelemetry/sdk-trace-node": "^1.30.1",
"@opentelemetry/semantic-conventions": "^1.28.0",

// devDeps:
"prisma": "^6.11.1",
// deps:
// prisma
"@prisma/client": "^6.11.1",
"@prisma/extension-optimize": "^2.0.0",
"@prisma/instrumentation": "^6.11.1",
// otel
"@opentelemetry/api": "^1.9.0",
"@opentelemetry/exporter-logs-otlp-http": "^0.57.2",
"@opentelemetry/exporter-trace-otlp-http": "^0.57.2",
"@opentelemetry/instrumentation": "^0.57.2",
"@opentelemetry/resources": "^1.30.1",
"@opentelemetry/sdk-node": "^0.57.2",
"@opentelemetry/sdk-trace-node": "^1.30.1",
"@opentelemetry/semantic-conventions": "^1.28.0",

// devDeps:
"prisma": "^6.11.1",
Interesting part of the trace:
SyntaxError: Named export 'PrismaInstrumentation' not found. The requested module 'prisma-instrumentation-5-x' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'prisma-instrumentation-5-x';
SyntaxError: Named export 'PrismaInstrumentation' not found. The requested module 'prisma-instrumentation-5-x' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'prisma-instrumentation-5-x';
Could post the full trace but it's just more of the transpiled js.
4 Replies
Prisma AI Help
Prisma AI Help5mo ago
You're in no rush, so we'll let a dev step in. Enjoy your coffee, or drop into #ask-ai if you get antsy for a second opinion!
Nurul
Nurul5mo ago
Can you check with the latest prisma version 6.12 and check if you get the same error?
Fresh
FreshOP5mo ago
No dice, same error
Nurul
Nurul5mo ago
Would it be possible for you to provide a reproduction repository so that I can share it with Optimize team?

Did you find this page helpful?