We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
openai
When running a Node.js (v20) server with ESM modules using dd-trace and openai packages, the process crashes with the following error:
dd-trace
➜ dd-trace-openai-nodejs-example git:(main) node --env-file=.env --import dd-trace/register.js index.js file:///Users/admin/workspace/personal/dd-trace-openai-nodejs-example/node_modules/openai/resources/index.mjs?iitm=true:72 let $Completions = namespace.Completions ^ SyntaxError: Identifier '$Completions' has already been declared at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:167:18) at callTranslator (node:internal/modules/esm/loader:285:14) at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:291:30) Node.js v20.11.0
Running node --import dd-trace/register.js index.js should start the server without crashing.
node --import dd-trace/register.js index.js
The following repository contains the code to reproduce the issue: dd-trace-openai-nodejs-example.
Using Node.js v20.11.0:
v20.11.0
npm init -y
npm i dd-trace@5.12.0 openai@4.40.0
package.json
{ "type": "module" }
index.js
import dataDogTracer from "dd-trace"; import OpenAI from "openai"; dataDogTracer.init({ logInjection: true, runtimeMetrics: true, }); const openAIClient = new OpenAI({ apiKey: process.env.OPENAI_API_KEY, }); ...
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When running a Node.js (v20) server with ESM modules using
dd-trace
andopenai
packages, the process crashes with the following error:Expected Behavior
Running
node --import dd-trace/register.js index.js
should start the server without crashing.Steps to Reproduce
Using Node.js
v20.11.0
:npm init -y
npm i dd-trace@5.12.0 openai@4.40.0
package.json
file:dd-trace
andopenai
in theindex.js
file:node --import dd-trace/register.js index.js
Your Environment
dd-trace
: 5.12.0openai
: 4.40.0The text was updated successfully, but these errors were encountered: