Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typescript error in the build process #608

Closed
mackovershay opened this issue Nov 3, 2020 · 4 comments
Closed

typescript error in the build process #608

mackovershay opened this issue Nov 3, 2020 · 4 comments

Comments

@mackovershay
Copy link

mackovershay commented Nov 3, 2020

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

@chris-armstrong
Copy link

I can confirm I'm seeing this as well. The odd part is that the SDK is packaged with .d.ts files for the compiled JS, so it's not clear why its being installed with the source .ts files (in my understanding, these should be eliminated via a .npmignore file).

@gitrkaplan
Copy link

I'm using SDK version 4.2.1 and am also seeing this issue.

@gitrkaplan
Copy link

@mackovershay Until the issue has been resolved on Optimizely's end, using 4.1.0 resolved my issue.

@yavorona
Copy link
Contributor

yavorona commented Nov 5, 2020

Thanks @mackovershay @chris-armstrong @gitrkaplan for reporting this issue. We merged #611 and released it in v4.4.1

@yavorona yavorona closed this as completed Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants