For me I used a CommonJS project which is not supported with llamaindex if you use the Stateful Middleware new stuff.
What I did is to switch the package.json
to ES modules in Node.js:
"type": "module"
And in the typescript update the other tsconfig.json
.