Closed
Description
Describe the bug / Current Behavior
Code like ace.require(/* ... */)
is no longer accepted by TypeScript.
Expected Behavior
Code like ace.require(/* ... */)
is still accepted by TypeScript.
Reproduction Steps
Create a basic TypeScript project
tsconfig.json
{
"compilerOptions": {
"target": "es2016",
"module": "commonjs",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
}
}
package.json
{
"name": "repro",
"version": "1.0.0",
"description": "",
"main": "index.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"ace-builds": "1.36.5",
"typescript": "^5.7.3"
}
}
index.ts
import * as ace from 'ace-builds';
ace.require('cow');
Run the project
pnpm tsc index.ts
Upgrade to 1.37.5, run project again
pnpm tsc index.ts
index.ts:3:5 - error TS2339: Property 'require' does not exist on type 'typeof import("ace-builds")'.
3 ace.require('cow');
~~~~~~~
Possible Solution
No response
Additional Information/Context
Going only by the changelog entry, the changes from @mkslanc in #5427 seem likely to be relevant.
Ace Version / Browser / OS / Keyboard layout
Ace 1.37.5 / TypeScript 5.7