Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
koshic opened this issue Mar 8, 2023 · 0 comments · Fixed by #53240
Closed

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

koshic opened this issue Mar 8, 2023 · 0 comments · Fixed by #53240
Assignees
Labels
Fix Available A PR has been opened for this issue Needs Investigation This issue needs a team member to investigate its status.

Comments

@koshic
Copy link

koshic commented Mar 8, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix Available A PR has been opened for this issue Needs Investigation This issue needs a team member to investigate its status.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants