optimizely/javascript-sdk

Type Error on 4.9.0

oudomsouk opened this issue · 2 comments

What I wanted to do

run npm run build for NextJS app with @optimizely/optimizely-sdk@^4.9.0

What actually happened

./node_modules/@optimizely/optimizely-sdk/lib/core/project_config/index.ts:787:31
Type error: Type 'unknown' is not assignable to type 'Error | null'.
Type 'unknown' is not assignable to type 'Error'.
785 | newDatafileObj = configValidator.validateDatafile(config.datafile);
786 | } catch (error) {
787 | return { configObj: null, error };
788 | }
789 |
790 | if (config.jsonSchemaValidator) {

Steps to reproduce

Link to repository that can reproduce the issue: link
Replace {OPTIMIZELY_KEY} in pages/index.tsx

@optimizely/optimizely-sdk version: 4.9.0

node version: 14.18.0

npm version: 6.14.11

Auto closed because i merged the PR. Opening it back. Will close it again after release and verification.

@oudomsouk This is fixed in version 4.9.1. Please explicitly update @optimizely/optimizely-sdk or do yarn upgrade @optimizely/optimizely-sdk or npm update @optimizely/optimizely-sdk to pull the latest version.