vike 0.4.240-commit-82bb0c2 → 0.4.240-commit-bcd07ae

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.
@@ -0,0 +1,2 @@
1
+ export { logErrorServer };
2
+ declare function logErrorServer(err: unknown): void;
@@ -0,0 +1,14 @@
1
+ export { logErrorServer };
2
+ import pc from '@brillout/picocolors';
3
+ import { isCallable, isObject } from './utils.js';
4
+ function logErrorServer(err) {
5
+ if (isObject(err) &&
6
+ // Set by react-streaming
7
+ isCallable(err.prettifyThisError)) {
8
+ err = err.prettifyThisError(err);
9
+ }
10
+ // We ensure we print a string; Cloudflare Workers doesn't seem to properly stringify `Error` objects.
11
+ // - TO-DO/eventuually: is that still true? Let's eventuually remove it and see if it crashes Cloudflare.
12
+ const errStr = isObject(err) && 'stack' in err ? String(err.stack) : String(err);
13
+ console.error(pc.red(errStr));
14
+ }
@@ -4,18 +4,16 @@ export { logErrorProd };
4
4
  export { onRuntimeError };
5
5
  import { isAbortError } from '../../../shared/route/abort.js';
6
6
  import { setAlreadyLogged } from './isNewError.js';
7
- import { isObject, warnIfErrorIsNotObject } from '../utils.js';
8
- import pc from '@brillout/picocolors';
7
+ import { warnIfErrorIsNotObject } from '../utils.js';
9
8
  import { logErrorHint } from './logErrorHint.js';
9
+ import { logErrorServer } from '../logErrorServer.js';
10
10
  function logErrorProd(err, _httpRequestId) {
11
11
  warnIfErrorIsNotObject(err);
12
12
  setAlreadyLogged(err);
13
13
  if (isAbortError(err)) {
14
14
  return;
15
15
  }
16
- // We ensure we print a string; Cloudflare Workers doesn't seem to properly stringify `Error` objects.
17
- const errStr = isObject(err) && 'stack' in err ? String(err.stack) : String(err);
18
- console.error(pc.red(errStr));
16
+ logErrorServer(err);
19
17
  // Needs to be called after logging the error.
20
18
  onRuntimeError(err);
21
19
  }
@@ -6,6 +6,7 @@ import { assert, stripAnsi, hasProp, assertIsNotProductionRuntime, PROJECT_VERSI
6
6
  import pc from '@brillout/picocolors';
7
7
  import { isErrorDebug } from '../../../shared/isErrorDebug.js';
8
8
  import { getViteDevServer } from '../../../runtime/globalContext.js';
9
+ import { logErrorServer } from '../../../runtime/logErrorServer.js';
9
10
  assertIsNotProductionRuntime();
10
11
  function logWithVikeTag(msg, logType, category, showVikeVersion = false) {
11
12
  const projectTag = getProjectTag(showVikeVersion);
@@ -40,7 +41,8 @@ function logDirectly(thing, logType) {
40
41
  return;
41
42
  }
42
43
  if (logType === 'error') {
43
- console.error(thing);
44
+ // console.error()
45
+ logErrorServer(thing);
44
46
  return;
45
47
  }
46
48
  if (logType === 'error-recover') {
@@ -1 +1 @@
1
- export declare const PROJECT_VERSION: "0.4.240-commit-82bb0c2";
1
+ export declare const PROJECT_VERSION: "0.4.240-commit-bcd07ae";
@@ -1,2 +1,2 @@
1
1
  // Automatically updated by @brillout/release-me
2
- export const PROJECT_VERSION = '0.4.240-commit-82bb0c2';
2
+ export const PROJECT_VERSION = '0.4.240-commit-bcd07ae';
@@ -158,7 +158,7 @@ function assertFlagsActivated() {
158
158
  function getFlagsActivated() {
159
159
  const flagsActivated = DEBUG.match(/\bvike:[a-zA-Z-]+/g) ?? [];
160
160
  const isAll = DEBUG.includes('vike:*');
161
- const isGlobal = /\bvike\b[^:]/.test(DEBUG);
161
+ const isGlobal = /\bvike\b([^:]|$)/.test(DEBUG);
162
162
  return { flagsActivated, isAll, isGlobal };
163
163
  }
164
164
  function isDebug() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vike",
3
- "version": "0.4.240-commit-82bb0c2",
3
+ "version": "0.4.240-commit-bcd07ae",
4
4
  "repository": "https://github.com/vikejs/vike",
5
5
  "exports": {
6
6
  "./server": {