Unreachable code error trying to upgrade canister

When I initially deploy my motoko canister, it seems to work fine and I don’t run into any errors on update/query calls. Then, when I try to upgrade the canister on the local replica with dfx deploy, I get an error
"Canister rwlgt-iiaaa-aaaaa-aaaaa-cai trapped explicitly: assertion failed at ~/.cache/dfinity/versions/0.8.0/base/Prelude.mo:30.5-30.17"

I don’t use the Prelude.unreachable() function anywhere in my code, so I’m not sure how this is being called. Is this possibly something with my pre/post-upgrade hooks?

I would expect this to come from some library you are using, not the Motoko runtime or primitives since these do not depend on functions defined in the base libraries.

I would grep for ‘unreachable’ in the base libraries or other libs you are importing.

I only found it in the motoko base library in Integer.mo. I did dfx start --clean and have not encountered the problem again.