wingify / vwo-node-sdk

VWO Node SDK for server-side testing
https://developers.vwo.com/docs/fullstack-overview
Apache License 2.0
24 stars 9 forks source link

TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided. #30

Closed Davidoseq closed 2 years ago

Davidoseq commented 2 years ago

Hello, I can't import enum LogLevelEnum because of isolatedModules. Can you look at it please?

https://codesandbox.io/s/strange-bas-borkk?file=/src/App.tsx

Reason is here: https://stackoverflow.com/questions/40227401/const-enum-in-typescript

Remove the const modifier should fix the problem.

Thank you very much.

softvar commented 2 years ago

Hi @Davidoseq,

As mentioned in #29 , please use:

vwoSDK.LogLevelEnum.INFO

instead of importing LogLevelEnum and using it. LogLevelEnum is exposed and has typings on vwoSDK

softvar commented 2 years ago

Closing the issue as it is fixed in the latest versions! Please let us know if you face any problems.