microsoft / microsoft/TypeScript
"Output generation failed" when transpiling "test.d.abc.ts"
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.4k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
🔎 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
}
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con la riproduzione di TS.transpileModule nell’issue, usando il nome file test.d.tsp.ts e le versioni di TypeScript indicate. Confronta il percorso di generazione dell’output che fallisce con la versione precedente funzionante e aggiungi un test di regressione per i nomi file che contengono .d.; il lavoro è completato quando la transpilation riesce producendo un output e senza crash.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- compilers
- Tipo di issue
- Bug
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 52/100