0

After upgrading to a newer version of TypeScript, I'm now getting this error:

node_modules/forge.packages.guishell/src/GuiShell.ts:2:26 - error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.

2 import * as UrlJoin from "url-join";

This is a package provided by another project that I don't have control over, but I need to upgrade TypeScript for newer packages I'm adding. From what is mentioned in Michael's answer in this post, This import syntax support changed in TypeScript v.2.7. But I've tried adding these properties to my tsconfig.json:

"compilerOptions": {
   "esModuleInterop": true,
   "allowSyntheticDefaultImports": true
}

But I get the same error. I've also tried switching out resolveJsonModule property as Edgar suggested in the comment of Michael's answer. All with the same result.

Any way that I can support this older import syntax used by this external dependency?

Ian Tunbridge
  • 33
  • 1
  • 5

0 Answers0