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

Property 'logging' does not exist on type 'typeof import("vwo-node-sdk")'. #29

Closed Davidoseq closed 2 years ago

Davidoseq commented 2 years ago

Hello, I am trying to configure Logger using React and Typescript. I used example from documentation.

Unfortunately I am getting an error regarding the logging property. I am trying call vwoSDK.logging.LogLevelEnum.INFO but I got TS error: Property 'logging' does not exist on type 'typeof import("vwo-node-sdk")'.ts(2339)

I'm using the last version of the package 1.29.

Here is the example: https://codesandbox.io/s/recursing-tess-41rhy?file=/src/App.tsx

Thank you very much.

softvar commented 2 years ago

Hi @Davidoseq ,

For TypeScript projects, please use the below code:

vwoSDK.LogLevelEnum.INFO

It should work.

LogLevelEnum is exposed and has typings on vwoSDK.

Davidoseq commented 2 years ago

Hello @softvar, thank you for so fast answer.

Unfortunately, it doesn't help. I get undefined from enum when i call vwoSDK.LogLevelEnum.INFO. I updated both example.

softvar commented 2 years ago

Hello @Davidoseq ,

Sorry for the trouble. Actually, LogLevelEnum was earlier available on vwoSDK.logging.LogLevelEnum but we had typings for TypeScript for vwoSDK.LogLevelEnum.

We have fixed it. Please update the VWO SDK to 1.30.1 and it should work.

I forked your example, updated the library, and it seems to be working now.

Please verify and let us know:

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.