braze-inc / braze-web-sdk

Public repo for the Braze Web SDK
https://www.braze.com
Other
70 stars 25 forks source link

[Bug]: braze type return as any and cause TS errors #135

Closed kevinlin505 closed 1 year ago

kevinlin505 commented 1 year ago

Braze Web SDK Version

4.50

Integration Method

NPM

Browser

Chrome

Steps To Reproduce

import * as braze from '@braze/web-sdk';

const useBrazeWebSdk = () => {
  braze.initialize('', {
    baseUrl: ''
  });
};

export default useBrazeWebSdk;

Expected Behavior

braze should be typed and not cause any issues.

Actual Incorrect Behavior

Getting the braze with a type of any

Unsafe call of an `any` typed value.eslint[@typescript-eslint/no-unsafe-call](https://github.com/typescript-eslint/typescript-eslint/blob/v4.22.0/packages/eslint-plugin/docs/rules/no-unsafe-call.md)

Verbose Logs

No response

Additional Information

Looking at previous issues, I also tried https://github.com/braze-inc/braze-web-sdk/issues/110#issuecomment-1006035189 the solution here but does seem to work anymore.

wesleyorbin commented 1 year ago

Hi @kevinlin505. I'm not able to reproduce this issue with the above code. None of the SDK methods return any as a type so I suspect there's maybe a misconfiguration somewhere. Can you share more details about your integration and provide a repro example?

kevinlin505 commented 1 year ago

Thanks for the reply, I think this is indeed a miss from my end.