PHP 7.4.33
Preview: utils.js Size: 2.84 KB
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/next/dist/server/node-environment-extensions/utils.js
"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "io", {
    enumerable: true,
    get: function() {
        return io;
    }
});
const _workasyncstorageexternal = require("../app-render/work-async-storage.external");
const _workunitasyncstorageexternal = require("../app-render/work-unit-async-storage.external");
const _dynamicrendering = require("../app-render/dynamic-rendering");
const _invarianterror = require("../../shared/lib/invariant-error");
function io(expression, type) {
    const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
    if (workUnitStore) {
        if (workUnitStore.type === 'prerender') {
            const workStore = _workasyncstorageexternal.workAsyncStorage.getStore();
            if (workStore) {
                let message;
                switch(type){
                    case 'time':
                        message = `Route "${workStore.route}" used ${expression} instead of using \`performance\` or without explicitly calling \`await connection()\` beforehand. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time`;
                        break;
                    case 'random':
                        message = `Route "${workStore.route}" used ${expression} outside of \`"use cache"\` and without explicitly calling \`await connection()\` beforehand. See more info here: https://nextjs.org/docs/messages/next-prerender-random`;
                        break;
                    case 'crypto':
                        message = `Route "${workStore.route}" used ${expression} outside of \`"use cache"\` and without explicitly calling \`await connection()\` beforehand. See more info here: https://nextjs.org/docs/messages/next-prerender-crypto`;
                        break;
                    default:
                        throw Object.defineProperty(new _invarianterror.InvariantError('Unknown expression type in abortOnSynchronousPlatformIOAccess.'), "__NEXT_ERROR_CODE", {
                            value: "E526",
                            enumerable: false,
                            configurable: true
                        });
                }
                const errorWithStack = Object.defineProperty(new Error(message), "__NEXT_ERROR_CODE", {
                    value: "E394",
                    enumerable: false,
                    configurable: true
                });
                (0, _dynamicrendering.abortOnSynchronousPlatformIOAccess)(workStore.route, expression, errorWithStack, workUnitStore);
            }
        } else if (workUnitStore.type === 'request' && workUnitStore.prerenderPhase === true) {
            const requestStore = workUnitStore;
            (0, _dynamicrendering.trackSynchronousPlatformIOAccessInDev)(requestStore);
        }
    }
}

//# sourceMappingURL=utils.js.map

Directory Contents

Dirs: 0 × Files: 18
Name Size Perms Modified Actions
11 B lrw-r--r-- 2025-03-28 11:04:44
Edit Download
2.29 KB lrw-r--r-- 2025-03-28 11:04:40
Edit Download
3.37 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
11 B lrw-r--r-- 2025-03-28 11:04:45
Edit Download
252 B lrw-r--r-- 2025-03-28 11:04:40
Edit Download
344 B lrw-r--r-- 2025-03-28 11:04:44
Edit Download
469 B lrw-r--r-- 2025-03-28 11:04:45
Edit Download
5.06 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
7.43 KB lrw-r--r-- 2025-03-28 11:04:44
Edit Download
435 B lrw-r--r-- 2025-03-28 11:04:45
Edit Download
1.18 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
1.67 KB lrw-r--r-- 2025-03-28 11:04:44
Edit Download
125 B lrw-r--r-- 2025-03-28 11:04:45
Edit Download
2.84 KB lrw-r--r-- 2025-03-28 11:04:42
Edit Download
3.42 KB lrw-r--r-- 2025-03-28 11:04:44
Edit Download
468 B lrw-r--r-- 2025-03-28 11:04:45
Edit Download
1.79 KB lrw-r--r-- 2025-03-28 11:04:43
Edit Download
2.72 KB lrw-r--r-- 2025-03-28 11:04:44
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).