-
Notifications
You must be signed in to change notification settings - Fork 26
Description
Describe the bug
All of a sudden today the build in our CI system started failing with the error:
FAIL src/__tests__/doc-state-subject.test.ts
● Test suite failed to run
ReferenceError: TextDecoder is not defined
> 1 | import CID from 'cids';
| ^
2 | import { DocStateSubject } from '../doc-state-subject';
3 | import { CommitType, DocState } from "../doctype";
4 |
at Object.<anonymous> (../../node_modules/uint8arrays/to-string.js:4:21)
at Object.<anonymous> (../../node_modules/cids/node_modules/multihashes/src/index.js:9:28)
at Object.<anonymous> (../../node_modules/cids/src/index.js:3:12)
at Object.<anonymous> (src/__tests__/doc-state-subject.test.ts:1:1)
Note that I didn't manually update package.json in any way to get to the newest version, we just use the ^
and ~
in some places to pull in newer minor versions of packages when they get released, but minor versions aren't supposed to include breaking changes. It seems like when uint8arrays v2.1.4 got released, npm picked it up and started using it in CI, which broke our build. Note our package.json specifies "uint8arrays": "^2.0.5"
.
I'm currently in the process of going through all our package.json files and pinning to version 2.0.5
to get things working again, but ideally this wouldn't be necessary as the semantic versioning system should already protect us against pulling in unexpected breaking changes.
Desktop (please complete the following information):
- OS: uname -a:
Linux Sonny 5.8.0-43-generic #49~20.04.1-Ubuntu SMP Fri Feb 5 09:57:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Additional context
Add any other context about the problem here.