Bug Report
π Search Terms
nodenext, node16, ESM, exports, package.json, dependency, postcss
π Version & Regression Information
[email protected]
β― Playground Link
Playground link with relevant code
Hilariously, the playground only seems to show this bug intermittently or doesnβt save the config. I can usually force the error to appear by setting the module configuration in the settings.

π» Code
index.ts
import postcss from "postcss";
console.log(postcss());
tsconfig.json
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"moduleResolution": "node16",
"lib": ["esnext", "dom"],
"strict": true
}
}
package.json
{
"name": "typescript-error-example",
"private": true,
"type": "module",
"license": "UNLICENSED",
"dependencies": {
"postcss": "^8.4.14",
"typescript": "^4.8.0-beta"
}
}
typescript-example.zip
π Actual behavior
Running npm i && tsc --noEmit on a directory configured like above produces the following error.
index.ts(3,13): error TS2349: This expression is not callable.
Type 'typeof import("/Users/briankim/typescript-example/node_modules/postcss/lib/postcss")' has no call signatures.
π Expected behavior
Running npm i && tsc --noEmit should produce no errors
Deleting "type": "module" from package.json or changing the moduleResolution to node in tsconfig.json makes the error go away. π
Bug Report
π Search Terms
nodenext, node16, ESM, exports, package.json, dependency, postcss
π Version & Regression Information
[email protected]
β― Playground Link
Playground link with relevant code
Hilariously, the playground only seems to show this bug intermittently or doesnβt save the config. I can usually force the error to appear by setting the
moduleconfiguration in the settings.π» Code
index.ts
tsconfig.json
{ "compilerOptions": { "target": "esnext", "module": "esnext", "moduleResolution": "node16", "lib": ["esnext", "dom"], "strict": true } }package.json
{ "name": "typescript-error-example", "private": true, "type": "module", "license": "UNLICENSED", "dependencies": { "postcss": "^8.4.14", "typescript": "^4.8.0-beta" } }typescript-example.zip
π Actual behavior
Running
npm i && tsc --noEmiton a directory configured like above produces the following error.π Expected behavior
Running
npm i && tsc --noEmitshould produce no errorsDeleting
"type": "module"frompackage.jsonor changing themoduleResolutiontonodeintsconfig.jsonmakes the error go away. π