vike 0.4.259-commit-cf2a786 → 0.4.259-commit-f2bab48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { generateVirtualFilePageEntry };
|
|
2
|
-
import { assert, getProjectError } from '../../../../utils/assert.js';
|
|
2
|
+
import { assert, getDebugInfoStr, getProjectError } from '../../../../utils/assert.js';
|
|
3
3
|
import { parseVirtualFileId, generateVirtualFileId } from '../../../../shared-server-node/virtualFileId.js';
|
|
4
4
|
import { getVikeConfigInternal } from '../../shared/resolveVikeConfigInternal.js';
|
|
5
5
|
import { extractAssetsAddQuery } from '../../../../shared-server-node/extractAssetsQuery.js';
|
|
@@ -26,12 +26,10 @@ async function generateVirtualFilePageEntry(id, isDev) {
|
|
|
26
26
|
assert(pageConfig);
|
|
27
27
|
}
|
|
28
28
|
else {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
throw getProjectError('Outdated request');
|
|
34
|
-
//*/
|
|
29
|
+
if (!pageConfig) {
|
|
30
|
+
// Happens very seldomly and can't reproduce reliably. Some kind of HMR race condition? It still happens as of June 2026 with Cloudflare Workers in developement — but it isn't blocking, reloading the page fixes the issue.
|
|
31
|
+
throw getProjectError(`Outdated request. Try again. ${getDebugInfoStr({ id, pageId })}`);
|
|
32
|
+
}
|
|
35
33
|
}
|
|
36
34
|
const code = getCode(pageConfig, isForClientSide, pageId, resolveIncludeAssetsImportedByServer(vikeConfig.config), isDev);
|
|
37
35
|
debug(id, isForClientSide ? 'CLIENT-SIDE' : 'SERVER-SIDE', code);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PROJECT_VERSION: "0.4.259-commit-
|
|
1
|
+
export declare const PROJECT_VERSION: "0.4.259-commit-f2bab48";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Automatically updated by @brillout/release-me
|
|
2
|
-
export const PROJECT_VERSION = '0.4.259-commit-
|
|
2
|
+
export const PROJECT_VERSION = '0.4.259-commit-f2bab48';
|
package/dist/utils/assert.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { assertUsage };
|
|
|
3
3
|
export { assertWarning };
|
|
4
4
|
export { assertInfo };
|
|
5
5
|
export { getProjectError };
|
|
6
|
+
export { getDebugInfoStr };
|
|
6
7
|
export { isVikeBug };
|
|
7
8
|
export { setAssertOnBeforeLog };
|
|
8
9
|
export { setAssertOnBeforeErr };
|
|
@@ -10,6 +11,7 @@ export { setAssertAlwaysShowStackTrace };
|
|
|
10
11
|
export { setAssertAddAssertTagsDev };
|
|
11
12
|
import type { AddAssertTagsDev } from '../node/vite/shared/loggerDev.js';
|
|
12
13
|
declare function assert(condition: unknown, debugInfo?: unknown): asserts condition;
|
|
14
|
+
declare function getDebugInfoStr(debugInfo: unknown): string | null;
|
|
13
15
|
declare function assertUsage(condition: unknown, errMsg: string, { showStackTrace, exitOnError }?: {
|
|
14
16
|
showStackTrace?: true;
|
|
15
17
|
exitOnError?: boolean;
|
package/dist/utils/assert.js
CHANGED
|
@@ -3,6 +3,7 @@ export { assertUsage };
|
|
|
3
3
|
export { assertWarning };
|
|
4
4
|
export { assertInfo };
|
|
5
5
|
export { getProjectError };
|
|
6
|
+
export { getDebugInfoStr };
|
|
6
7
|
export { isVikeBug };
|
|
7
8
|
export { setAssertOnBeforeLog };
|
|
8
9
|
export { setAssertOnBeforeErr };
|
|
@@ -24,17 +25,10 @@ const tagTypeBug = 'Bug';
|
|
|
24
25
|
function assert(condition, debugInfo) {
|
|
25
26
|
if (condition)
|
|
26
27
|
return;
|
|
27
|
-
const debugStr = (() => {
|
|
28
|
-
if (!debugInfo) {
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
const debugInfoSerialized = typeof debugInfo === 'string' ? debugInfo : JSON.stringify(debugInfo);
|
|
32
|
-
return pc.dim(`Debug for maintainers (you can ignore this): ${debugInfoSerialized}`);
|
|
33
|
-
})();
|
|
34
28
|
const link = pc.underline('https://github.com/vikejs/vike/issues/new?template=bug.yml');
|
|
35
29
|
let errMsg = [
|
|
36
30
|
`You stumbled upon a Vike bug. Go to ${link} and copy-paste this error. A maintainer will fix the bug (usually within 24 hours).`,
|
|
37
|
-
|
|
31
|
+
getDebugInfoStr(debugInfo),
|
|
38
32
|
]
|
|
39
33
|
.filter(Boolean)
|
|
40
34
|
.join(' ');
|
|
@@ -44,6 +38,12 @@ function assert(condition, debugInfo) {
|
|
|
44
38
|
globalObject.onBeforeErr?.(internalError);
|
|
45
39
|
throw internalError;
|
|
46
40
|
}
|
|
41
|
+
function getDebugInfoStr(debugInfo) {
|
|
42
|
+
if (!debugInfo)
|
|
43
|
+
return null;
|
|
44
|
+
const debugInfoSerialized = typeof debugInfo === 'string' ? debugInfo : JSON.stringify(debugInfo);
|
|
45
|
+
return pc.dim(`Debug for maintainers (you can ignore this): ${debugInfoSerialized}`);
|
|
46
|
+
}
|
|
47
47
|
function assertUsage(condition, errMsg, { showStackTrace, exitOnError } = {}) {
|
|
48
48
|
if (condition)
|
|
49
49
|
return;
|