Remove automatic prefetch warning

This commit is contained in:
Konstantin Wohlwend 2025-03-05 13:50:46 -08:00
parent 7a3ae7b5d3
commit af89dc7321
2 changed files with 1 additions and 8 deletions

View File

@ -93,6 +93,7 @@ async function main() {
}),
]);
if (users.pagination?.next_cursor) throwErr("Users are paginated? Please update the verify-data-integrity.ts script to handle this.");
if (currentProject.user_count !== users.items.length) throwErr("User count mismatch.");
for (let j = 0; j < users.items.length; j++) {
const user = users.items[j];

View File

@ -58,7 +58,6 @@ const NextNavigation = scrambleDuringCompileTime(NextNavigationUnscrambled);
const process = (globalThis as any).process ?? { env: {} };
let numberOfAppsCreated = 0;
const allClientApps = new Map<string, [checkString: string, app: StackClientApp<any, any>]>();
export class _StackClientAppImplIncomplete<HasTokenStore extends boolean, ProjectId extends string = string> {
@ -281,13 +280,6 @@ export class _StackClientAppImplIncomplete<HasTokenStore extends boolean, Projec
this._uniqueIdentifier = _options.uniqueIdentifier;
this._initUniqueIdentifier();
}
if (!_options.noAutomaticPrefetch) {
numberOfAppsCreated++;
if (numberOfAppsCreated > 10) {
(process.env.NODE_ENV === "development" ? console.log : console.warn)(`You have created more than 10 Stack apps with automatic pre-fetch enabled (${numberOfAppsCreated}). This is usually a sign of a memory leak, but can sometimes be caused by hot reload of your tech stack. If you are getting this error and it is not caused by hot reload, make sure to minimize the number of Stack apps per page (usually, one per project). (If it is caused by hot reload and does not occur in production, you can safely ignore it.)`);
}
}
}
protected _initUniqueIdentifier() {