vike 0.4.240-commit-309067c → 0.4.240-commit-95fc969
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.
- package/dist/esm/client/runtime-client-routing/renderPageClientSide.js +4 -4
- package/dist/esm/node/runtime/renderPage.js +6 -5
- package/dist/esm/node/vite/plugins/pluginFileEnv.js +4 -2
- package/dist/esm/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/esm/utils/PROJECT_VERSION.js +1 -1
- package/package.json +1 -1
|
@@ -241,7 +241,7 @@ async function renderPageClientSide(renderArgs) {
|
|
|
241
241
|
// We don't swallow 404 errors:
|
|
242
242
|
// - On the server-side, Vike swallows / doesn't show any 404 error log because it's expected that a user may go to some random non-existent URL. (We don't want to flood the app's error tracking with 404 logs.)
|
|
243
243
|
// - On the client-side, if the user navigates to a 404 then it means that the UI has a broken link. (It isn't expected that users can go to some random URL using the client-side router, as it would require, for example, the user to manually change the URL of a link by manually manipulating the DOM which highly unlikely.)
|
|
244
|
-
|
|
244
|
+
logErrorClient(err);
|
|
245
245
|
}
|
|
246
246
|
else {
|
|
247
247
|
// We swallow throw redirect()/render() called by client-side hooks onBeforeRender()/data()/guard()
|
|
@@ -272,7 +272,7 @@ async function renderPageClientSide(renderArgs) {
|
|
|
272
272
|
- An infinite reloading page is a even worse UX than a blank page.
|
|
273
273
|
redirectHard(urlOriginal)
|
|
274
274
|
*/
|
|
275
|
-
|
|
275
|
+
logErrorClient(err);
|
|
276
276
|
};
|
|
277
277
|
const errorPageId = getErrorPageId(pageContext._pageFilesAll, pageContext._globalContext._pageConfigs);
|
|
278
278
|
if (!errorPageId)
|
|
@@ -384,7 +384,7 @@ async function renderPageClientSide(renderArgs) {
|
|
|
384
384
|
await handleError({ err });
|
|
385
385
|
}
|
|
386
386
|
else {
|
|
387
|
-
|
|
387
|
+
logErrorClient(err);
|
|
388
388
|
}
|
|
389
389
|
};
|
|
390
390
|
// We use globalObject.onRenderClientPreviousPromise in order to ensure that there is never two concurrent onRenderClient() calls
|
|
@@ -665,7 +665,7 @@ if (import.meta.env.DEV && import.meta.hot)
|
|
|
665
665
|
});
|
|
666
666
|
}
|
|
667
667
|
});
|
|
668
|
-
function
|
|
668
|
+
function logErrorClient(err) {
|
|
669
669
|
if (isObject(err) &&
|
|
670
670
|
// Set by vike-react
|
|
671
671
|
// https://github.com/vikejs/vike-react/blob/195a208c6b77e7f34496e1f637278a36c60fbe07/packages/vike-react/src/integration/onRenderClient.tsx#L109
|
|
@@ -64,11 +64,12 @@ async function renderPagePrepare(pageContextInit, httpRequestId) {
|
|
|
64
64
|
await initGlobalContext_renderPage();
|
|
65
65
|
}
|
|
66
66
|
catch (err) {
|
|
67
|
-
// Errors are expected
|
|
68
|
-
//
|
|
69
|
-
//
|
|
70
|
-
//
|
|
71
|
-
//
|
|
67
|
+
// Errors are expected:
|
|
68
|
+
// - assertUsage() such as:
|
|
69
|
+
// ```bash
|
|
70
|
+
// Re-build your app (you're using 1.2.3 but your app was built with 1.2.2)
|
|
71
|
+
// ```
|
|
72
|
+
// - initGlobalContext_renderPage() depends on +onCreateGlobalContext hooks
|
|
72
73
|
assert(!isAbortError(err));
|
|
73
74
|
logRuntimeError(err, httpRequestId);
|
|
74
75
|
const pageContextWithError = getPageContextHttpResponseErrorWithoutGlobalContext(err, pageContextInit);
|
|
@@ -42,8 +42,10 @@ function pluginFileEnv() {
|
|
|
42
42
|
if (id.endsWith('?direct'))
|
|
43
43
|
id = id.slice(0, -1 * '?direct'.length);
|
|
44
44
|
const moduleInfo = viteDevServer.moduleGraph.getModuleById(id);
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
/* It can fail, no clue why — https://github.com/vikejs/vike/issues/2740
|
|
46
|
+
assert(moduleInfo, { moduleId })
|
|
47
|
+
*/
|
|
48
|
+
const importers = (!moduleInfo ? [] : Array.from(moduleInfo.importers))
|
|
47
49
|
.map((m) => m.id)
|
|
48
50
|
.filter((id) => id !== null);
|
|
49
51
|
assertFileEnv(id, isViteServerSide_extraSafe(config, this.environment, options), importers,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PROJECT_VERSION: "0.4.240-commit-
|
|
1
|
+
export declare const PROJECT_VERSION: "0.4.240-commit-95fc969";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Automatically updated by @brillout/release-me
|
|
2
|
-
export const PROJECT_VERSION = '0.4.240-commit-
|
|
2
|
+
export const PROJECT_VERSION = '0.4.240-commit-95fc969';
|