Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Potential work-around for Rollup cyclic dependency bug (#2332)
# Motivation There is a bug in Rollup that non-deterministically fails to detect cyclic dependencies. rollup/plugins#1425 As a result `lru-cache` is sometimes wrapped in a `requireLruCache` function and sometimes it is not. This makes our build non-deterministic. `lru-caceh` is not itself part of a circular dependency but `semver/classes/range.js`, which depends on `lru-cache`, is. By depending on `lru-cache` directly from our app, we change the order in which modules are analyzed by Rollup, hopefully avoiding the buggy behavior. It probably doesn't matter where we put this import, so I put it as close to the root of the app as I could find. # Changes Add `import "lru-cache"` in frontend/src/routes/+layout.ts # Tests Inspected generated `vendor` chunk to see that it does not have `hasRequiredLruCache`. `dfx deploy nns-dapp` locally and did some manual testing.
- Loading branch information