## TL;DR

Upgrade to 4.4.3 (react-sdk 2.4.1), which ships only the compiled dist output again. optimizely-sdk 4.1.1 accidentally shipped raw TypeScript sources, which breaks consumer builds with TS errors that tsconfig exclude and skipLibCheck cannot fix.

## Steps

1. optimizely-sdk 4.1.1 accidentally shipped raw TypeScript sources, which breaks consumer builds with TS errors that tsconfig exclude and skipLibCheck cannot fix. Upgrade to 4.4.3 (react-sdk 2.4.1), which ships only the compiled dist output again. If you are pinned, 4.3.4 also builds fine as a stopgap.

2. https://github.com/optimizely/javascript-sdk/issues/613: Issue optimizely/javascript-sdk#613 (closed, 10 comments): version 4.1.1 shipped raw TypeScript sources instead of just the compiled dist output, so consuming apps (including via react-sdk) failed to build with TS errors that tsconfig exclude and skipLibCheck could not fix. Maintainers fixed the packaging and released optimizely-sdk 4.4.3, with react-sdk 2.4.1.

## When to use

You are seeing this: If you are pinned, 4.3.4 also builds fine as a stopgap. Use this skill when you run into "TypeScript build errors after upgrading optimizely-sdk to 4.1.1".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

Versions mentioned in the source: optimizely-sdk 4.1.1, 4.4.3, react-sdk 2.4.1, pinned 4.3.4. If you are on something much newer or older, the details may have shifted.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

## Sources

- https://github.com/optimizely/javascript-sdk/issues/613:
