Cannot find module 'readline/promises' error in production
vyktoremario opened this issue · 8 comments
I was using Typechat in a project I worked on and it worked fine during development, The deployed version was raising the following error from that library: Cannot find module 'readline/promises'
,
Could it be that it's not bundled properly, or doesn't work in a lambda environment for some reason?
I need some help here.
Hey!
What version of node are you using?
Hi @SweetpopcornSimon I am using version ^18.13.0 of node
Okay I had that problem and the issue was I didn't have the right node or typescript version, I upgraded node to 18.17.1 and my package.json looks like this
"devDependencies": { "@types/node": "^20.3.1", "copyfiles": "^2.4.1", "typescript": "^5.1.3" }
This thread helped me find the issue TypeStrong/ts-node#1638
@SweetpopcornSimon thanks for the response.
I will try this out and let you know if it works
@vyktoremario did it work?
@SweetpopcornSimon It did not work.
We had to disable it for now as it was blocking some features from going live.
It sounds like this was an issue with the target runtime. I believe if you use Node 20 or later, you should have no issues here.
My project uses react-scripts and is running on node V20 but I still see this error.