File tree 2 files changed +5
-13
lines changed
src/lib/utils/options/readers
2 files changed +5
-13
lines changed Original file line number Diff line number Diff line change 2
2
3
3
### Bug Fixes
4
4
5
+ - Fix support for ESM config files with Node 23, #2752 .
5
6
- Fix type errors when using ` "module": "ESNext" ` and importing TypeDoc, #2747 .
6
7
7
8
## v0.26.10 (2024-10-16)
Original file line number Diff line number Diff line change @@ -84,19 +84,10 @@ export class TypeDocReader implements OptionsReader {
84
84
}
85
85
} else {
86
86
try {
87
- try {
88
- // eslint-disable-next-line @typescript-eslint/no-require-imports
89
- fileContent = await require ( file ) ;
90
- } catch ( error : any ) {
91
- if ( error ?. code === "ERR_REQUIRE_ESM" ) {
92
- // On Windows, we need to ensure this path is a file path.
93
- // Or we'll get ERR_UNSUPPORTED_ESM_URL_SCHEME
94
- const esmPath = pathToFileURL ( file ) . toString ( ) ;
95
- fileContent = await ( await import ( esmPath ) ) . default ;
96
- } else {
97
- throw error ;
98
- }
99
- }
87
+ // On Windows, we need to ensure this path is a file path.
88
+ // Or we'll get ERR_UNSUPPORTED_ESM_URL_SCHEME
89
+ const esmPath = pathToFileURL ( file ) . toString ( ) ;
90
+ fileContent = await ( await import ( esmPath ) ) . default ;
100
91
} catch ( error ) {
101
92
logger . error (
102
93
logger . i18n . failed_read_options_file_0 ( nicePath ( file ) ) ,
You can’t perform that action at this time.
0 commit comments