Solution skill
TypeScript build errors after upgrading optimizely-sdk to 4.1.1
Complete solution
Shows how to fix typeScript build errors after upgrading optimizely-sdk to 4.1.1. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
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
- 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.
- 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:
Evidence
Issue gh:optimizely/javascript-sdk#613: the reporter asked: 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. The verified answer was: 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. Evidence thread: https://github.com/optimizely/javascript-sdk/issues/613
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_yIJsPpap71ZZpC9gB9B1HQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">TypeScript build errors after upgrading optimizely-sdk to 4.1.1 <span>— Vectle</span></a>