heartbeat-monitor/node_modules/next/dist/server/dynamic-rendering-utils.js
Matt Bruce bed1169443 Initial commit: Heartbeat Monitor dashboard
- Full-featured monitoring dashboard for local web apps
- Real-time status tracking with uptime percentages
- Visual sparklines for status history
- Add/Edit/Delete apps dynamically
- Categories and color coding
- Auto-refresh every 30 seconds
- API endpoints for apps and status management
2026-02-18 11:16:01 -06:00

33 lines
1.4 KiB
JavaScript

/**
* This function constructs a promise that will never resolve. This is primarily
* useful for dynamicIO where we use promise resolution timing to determine which
* parts of a render can be included in a prerender.
*
* @internal
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "makeHangingPromise", {
enumerable: true,
get: function() {
return makeHangingPromise;
}
});
function makeHangingPromise(signal, expression) {
const hangingPromise = new Promise((_, reject)=>{
signal.addEventListener('abort', ()=>{
reject(new Error(`During prerendering, ${expression} rejects when the prerender is complete. Typically these errors are handled by React but if you move ${expression} to a different context by using \`setTimeout\`, \`after\`, or similar functions you may observe this error and you should handle it in that context.`));
}, {
once: true
});
});
// We are fine if no one actually awaits this promise. We shouldn't consider this an unhandled rejection so
// we attach a noop catch handler here to suppress this warning. If you actually await somewhere or construct
// your own promise out of it you'll need to ensure you handle the error when it rejects.
hangingPromise.catch(ignoreReject);
return hangingPromise;
}
function ignoreReject() {}
//# sourceMappingURL=dynamic-rendering-utils.js.map