Skip to content

5.x.x: transpileModule fails with TS5104 error when verbatimModuleSyntax: true #53160

Closed
@koshic

Description

@koshic

Bug Report

transpileModule fails with TS5104 error when verbatimModuleSyntax: true
"TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'"

Why? According to those comments (and source code)

* Extra compiler options that will unconditionally be used by this function are:
* - isolatedModules = true
* - allowNonTsExtensions = true
* - noLib = true
* - noResolve = true
*/
export function transpileModule(input: string, transpileOptions: TranspileOptions): TranspileOutput {

it unconditionally adds 'isolatedModules: true' to compiler options. And fails because verbatimModuleSyntax is not compatible with isolatedModules.

🔎 Search Terms

verbatimModuleSyntax
isolatedModules
transpileModule

🕗 Version & Regression Information

5.0.1-rc
5.1.0-dev.20230307

  • I was unable to test this on prior versions because verbatimModuleSyntax is not available in 4.x

⏯ Playground Link

N/A

💻 Code

transpileModule('any valid code', {compilerOptions: {verbatimModuleSyntax: true, /* common options like module, etc. */}})

🙁 Actual behavior

TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'

🙂 Expected behavior

No errors

Metadata

Metadata

Assignees

Labels

Fix AvailableA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions