2. There is an api route called example which uses an export named "someValue" from "src/lib/someModule". 3. In the file "someModule", "someValue" is exported similarly to how prisma get's exported to prevent problems related to multiple instances during npm run dev.
"/api/example" works fine the first time. But if we make some changes to src/pages/index.tsx which leads to fast refresh, /api/example becomes unresponsive.
I am not entirely sure why this happens, but it definitely seems related to node global and the top level await being used.
If I don't use an async function with top-level await (rest everything being the same), this problem doesn't happen.
Trying to understand why this happens and looking for suggestions on how to make this work with async functions.