Skip to content

Is esModuleInterop: true needed in tsconfig? #1674

@vzarskus

Description

@vzarskus

🗄️ Docs report

Description

In https://scully.io/docs/learn/getting-started/manualInstallation/ page it is shown that we should set "esModuleInterop": true for Scully plugins tsconfig.json.
As far as I understand, this flag is used to address some possible issues when importing CommonJS modules to ES6 modules https://www.typescriptlang.org/tsconfig#esModuleInterop.
The manual installation docs also state that we should set "module": "commonjs" which means that all the TS code will be compiled to JS that uses CommonJS module system. Thus, if we are supposed to compile to CommonJS, why do we need to also set "esModuleInterop": true?

I am submitting this issue because I would like to make sure that turning off esModuleInterop will not break anything or result in some unexpected behavior from Scully. We recently had a subtle bug related to module imports and turning off esModuleInterop is one of the possible fixes (I don't think that expanding on the bug here is relevant so I will stop here).

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions