## TL;DR

Lodash and promises were removed in v4, but v5 grew again with ODP. Maintainers shipped v6 with a modular API that supports tree-shaking of unused components like OdpManager, significantly cutting bundle size.

## Steps

1. Issue optimizely/javascript-sdk#352 (closed, 11 comments): the distributed SDK was large (lodash, promise polyfill, then ODP and ua-parser-js in v5). Lodash and promises were removed in v4, but v5 grew again with ODP. Maintainers shipped v6 with a modular API that supports tree-shaking of unused components like OdpManager, significantly cutting bundle size.

2. If the SDK bundle is too big, upgrade to v6, which has a modular API so bundlers can tree-shake unused pieces like OdpManager. On v5, import from @optimizely/optimizely-sdk/lite for edge-style deploys to skip the heavier modules, and disable ODP via odpOptions { disabled: true } if you dont use it, since ODP pulls in ua-parser-js.

## When to use

You are seeing this: Issue optimizely/javascript-sdk#352 (closed, 11 comments): the distributed SDK was large (lodash, promise polyfill, then ODP and ua-parser-js in v5). Use this skill when you run into "Shrink the optimizely-sdk bundle with v6 or the lite import".

## 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

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## 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/352
