Skip to content

typescript error in the build process #608

@mackovershay

Description

@mackovershay

After I updated the optimizley-sdk to version 4.4.0 my build process started to fail
I am using typescript(4.0.5) and I started to get the following errors after the upgrade:
node_modules/@optimizely/optimizely-sdk/lib/optimizely/index.ts:150:11 - error TS2322: Type 'UserProfileService' is not assignable to type 'null'.

150 userProfileService = config.userProfileService;
~~~~~~~~~~~~~~~~~~

node_modules/@optimizely/optimizely-sdk/lib/optimizely/index.ts:335:7 - error TS2322: Type 'string' is not assignable to type 'null'.

335 variationId = projectConfig.getVariationIdFromExperimentAndVariationKey(configObj, experimentKey, variationKey);
~~~~~~~~~~~

node_modules/@optimizely/optimizely-sdk/lib/optimizely/index.ts:336:7 - error TS2322: Type 'string' is not assignable to type 'null'.

336 experimentId = projectConfig.getExperimentId(configObj, experimentKey);
~~~~~~~~~~~~
I have downgraded the SDK to version 4.3.4 and everything works as expected.

@optimizely/optimizely-sdk version: 4.4.0

node version: 12.17

npm version: 6.14.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions