/Users/rishi/Projects/mcpx-openai-chat/index.js:2 import { McpxOpenAI } from "@dylibso/mcpx-openai"; ^^^^^^
SyntaxError: Cannot use import statement outside a module at internalCompileFunction (node:internal/vm:77:18) at wrapSafe (node:internal/modules/cjs/loader:1288:20) at Module._compile (node:internal/modules/cjs/loader:1340:27) at Module._extensions..js (node:internal/modules/cjs/loader:1435:10) at Module.load (node:internal/modules/cjs/loader:1207:32) at Module._load (node:internal/modules/cjs/loader:1023:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12) at node:internal/main/run_main_module:28:49
For now, in order to fix it and run, I added type as module in package.json and renamed index.js to index.mjs (i guess either should work?)
{
"name": "mcpx-openai-chat",
"version": "1.0.0",
"type": "module",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@dylibso/mcpx-openai": "^0.0.2",
"openai": "^4.77.3",
"pino": "^9.6.0",
"pino-pretty": "^13.0.0"
}
}