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.
@@ -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
- logError(err);
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
- logError(err);
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
- logError(err);
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 logError(err) {
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 since assertUsage() is used in initGlobalContext_renderPage() such as:
68
- // ```bash
69
- // Re-build your app (you're using 1.2.3 but your app was built with 1.2.2)
70
- // ```
71
- // initGlobalContext_renderPage() doesn't call any user hook => err isn't thrown from user code.
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
- assert(moduleInfo);
46
- const importers = Array.from(moduleInfo.importers)
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-309067c";
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-309067c';
2
+ export const PROJECT_VERSION = '0.4.240-commit-95fc969';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vike",
3
- "version": "0.4.240-commit-309067c",
3
+ "version": "0.4.240-commit-95fc969",
4
4
  "repository": "https://github.com/vikejs/vike",
5
5
  "exports": {
6
6
  "./server": {