#stdin is a ReadStream but readline interface requires ReadableStream

21 messages · Page 1 of 1 (latest)

wheat merlin
#

I'm so confused, please help

import { createInterface } from "node:readline/promises";
import { stdin as input, stdout as output } from "node:process";

const rl = createInterface({ input, output });
#

it was okay until i turned on a more recent and strict typescript

#

now it complains for some reason

#

maybe i miss some kind of tsconfig setting?

wheat ruin
#

Can you show your tsconfig and package.json?

wheat merlin
#
{
  "type": "module",
  "main": "./out/main.js",
  "dependencies": {
    "@types/node": "^20.14.8",
    "discord.js": "^14.15.3"
  },
  "devDependencies": {
    "typescript": "^5.5.2"
  }
}
``````json
{
    "compilerOptions": {
        "allowArbitraryExtensions": false,
        "allowImportingTsExtensions": false,
        "allowUmdGlobalAccess": false,
        "allowUnreachableCode": false,
        "allowUnusedLabels": false,
        "alwaysStrict": true,
        "exactOptionalPropertyTypes": true,
        "incremental": true,
        "module": "Node16",
        "moduleResolution": "Node16",
        "noFallthroughCasesInSwitch": true,
        "noImplicitAny": true,
        "noImplicitOverride": true,
        "noImplicitReturns": true,
        "noImplicitThis": true,
        "noPropertyAccessFromIndexSignature": true,
        "noUncheckedIndexedAccess": true,
        "noUnusedLocals": true,
        "noUnusedParameters": true,
        "sourceMap": true,
        "strictBindCallApply": true,
        "strictFunctionTypes": true,
        "strictNullChecks": true,
        "strictPropertyInitialization": true,
        "useUnknownInCatchVariables": true,
        "outDir": "build",
        "strict": true
    }
}
#

modules were nodenext but changing to node 16 didn't help

wheat ruin
#

Your exact code works in TS playground, so it might be a setup issue.

#

What do you see when you run tsc?

wheat merlin
#

hm

#

i experimented a little and this issue starts somewhere between typescript 5.5.0-beta and 5.5.1-rc

#

regression comes from this version and later
https://www.npmjs.com/package/typescript/v/5.5.0-dev.20240524

#

or not a regression, my issue

wheat merlin
wheat ruin
#

No but I mean if it works on playground using the same TS 5.5.2, then the issue is likely your setup not the version of TS.

wheat merlin
#

okay, thats some weird combination of discord js 14+ and new typescript builds

#

probably discord.js issue. thanks for help

#

it's indeed discord.js issue