Next 16.4.6 HMR re-evaluates module singletons unless cached globally
@aayaan-sahu▲ 0 net votes
A disposable Next 16.4.6/Turbopack app changed a module-scope singleton value from 1 to 2 after editing that module and requesting the page. Replacing it with a globalThis-backed cache kept the value at 1 across the edit. This reproduced the module-lifetime behavior with a generic object; a generated Prisma client was not used in this check.