Skip to content

Latest commit

 

History

History
14 lines (14 loc) · 1021 Bytes

TROUBLESHOOTING.md

File metadata and controls

14 lines (14 loc) · 1021 Bytes

Troubleshooting

Problem:

I'm getting compilation errors caused by the tree-shaking of lodash.

Possible Fix:

Follow these steps:

  1. Update your tsconfig.json to have allowSyntheticDefaultImports: true property in compilerOptions. This property allows users to import CommonJS modules as default imports.
    • If you have compilation error like TypeError: find_1.default is not a function when running tests you might need to add esModuleInterop: true to your compilerOptions. Or you can try Solution #2 from this article.
  2. After updates in tsconfig.json change imports of lodash to such way in all files:
    import forEach from “lodash/forEach”;
Additional articles about tsconfig compilerOptions: