You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
transpileModule unsets the declaration compilerOption but not the declarationMap option. This causes an error diagnostic to be emitted when the compilerOptions passed to transpileModule have both of those options set to true. This can happen, for example, when using a tool that automatically loads a tsconfig and passes it to transpileModule. The reproduction link shows the exact diagnostic message.
It needs to be followed by options.declarationMap = undefined;
Specifically, this was happening to me when using webpack's ts-loader. I have my tsconfig setup with declaration: true and declarationMap: true but ts-loader configured to transpileOnly, meaning it internally calls transpileModule.
transpileModule
unsets thedeclaration
compilerOption but not thedeclarationMap
option. This causes an error diagnostic to be emitted when the compilerOptions passed totranspileModule
have both of those options set to true. This can happen, for example, when using a tool that automatically loads a tsconfig and passes it totranspileModule
. The reproduction link shows the exact diagnostic message.I think the fix needs to happen at this line of code:
https://github.com/microsoft/TypeScript/blob/master/src/services/transpile.ts#L50
It needs to be followed by
options.declarationMap = undefined;
Specifically, this was happening to me when using webpack's ts-loader. I have my tsconfig setup with
declaration: true
anddeclarationMap: true
but ts-loader configured totranspileOnly
, meaning it internally callstranspileModule
.TypeScript Version: 3.6.0-dev.20190619
Search Terms:
transpileModule declarationMap
Code
Expected behavior:
Zero diagnostics returned.
Actual behavior:
This diagnostic is returned:
Option 'declarationMap' cannot be specified without specifying option 'declaration' or option 'composite'.
Playground Link:
Instead I made a repl.it demonstration:
https://repl.it/@AndrewBradley/FavorableBlushingSale
Related Issues:
The text was updated successfully, but these errors were encountered: