microsoft / microsoft/TypeScript
"Output generation failed" when transpiling "test.d.abc.ts"
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.3k
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 117
Beschreibung
🔎 Search Terms
"Output generation failed", "transpileModule"
🕗 Version & Regression Information
- This is a crash
- This changed between versions 5.0.0-dev.20230109 and 5.0.0-dev.20230110
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about file names
⏯ Playground Link
No response
💻 Code
const TS = require('typescript')
const res = TS.transpileModule('export const x = 6;', {
fileName: 'test.d.tsp.ts',
});
console.log(res)
🙁 Actual behavior
The Typescript compiler crashes. The compiler should allow files that contain .d. in their name.
🙂 Expected behavior
The compilation succeeds
Additional information about the issue
c:\Users\osv\Downloads\test>npm i typescript@5.0.0-dev.20230110
changed 1 package, and audited 2 packages in 5s
found 0 vulnerabilities
c:\Users\osv\Downloads\test>node main.js
c:\Users\osv\Downloads\test\node_modules\typescript\lib\typescript.js:1772
throw e;
^
Error: Debug Failure. Output generation failed
at Object.transpileModule (c:\Users\osv\Downloads\test\node_modules\typescript\lib\typescript.js:127318:20)
at Object.<anonymous> (c:\Users\osv\Downloads\test\main.js:3:16)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
at node:internal/main/run_main_module:28:49
Node.js v20.11.1
c:\Users\osv\Downloads\test>npm i typescript@5.0.0-dev.20230109
changed 1 package, and audited 2 packages in 745ms
found 0 vulnerabilities
c:\Users\osv\Downloads\test>node main.js
{
outputText: '"use strict";\r\n' +
'Object.defineProperty(exports, "__esModule", { value: true });\r\n' +
'exports.x = void 0;\r\n' +
'exports.x = 6;\r\n',
diagnostics: [],
sourceMapText: undefined
}
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit der TS.transpileModule-Reproduktion im Issue unter Verwendung des Dateinamens test.d.tsp.ts und der angegebenen TypeScript-Versionen. Vergleiche den fehlschlagenden Pfad zur Ausgabeerzeugung mit der erfolgreichen älteren Version und füge einen Regressionstest für Dateinamen hinzu, die .d. enthalten; als erledigt gilt die Transpilierung, wenn sie mit Ausgabe erfolgreich ist und kein Absturz auftritt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- typescript
- Bereich
- compilers
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 52/100