Skip to content

Commit

Permalink
fix(scheduler+ssr): correct order and draining
Browse files Browse the repository at this point in the history
  • Loading branch information
wmertens committed Jan 22, 2025
1 parent a052f8f commit ec7e9b2
Show file tree
Hide file tree
Showing 10 changed files with 214 additions and 295 deletions.
18 changes: 8 additions & 10 deletions packages/qwik/src/core/shared/error/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const codeToText = (code: number, ...parts: any[]): string => {
const MAP = [
'Error while serializing class or style attributes', // 0
'Scheduler not found', // 1
'', // 2 unused
'track() received object, without prop to track', // 2
'Only primitive and object literals can be serialized. {{0}}', // 3
'', // 4 unused
'You can render over a existing q:container. Skipping render().', // 5
Expand Down Expand Up @@ -50,12 +50,11 @@ export const codeToText = (code: number, ...parts: any[]): string => {
"Element must have 'q:container' attribute.", // 42
'Unknown vnode type {{0}}.', // 43
'Materialize error: missing element: {{0}} {{1}} {{2}}', // 44
'Cannot coerce a Signal, use `.value` instead', // 46
'useComputedSignal$ QRL {{0}} {{1}} returned a Promise', // 47
'ComputedSignal is read-only', // 48
'WrappedSignal is read-only', // 49
'SsrError: Promises not expected here.', // 50
'Attribute value is unsafe for SSR', // 51
'Cannot coerce a Signal, use `.value` instead', // 45
'useComputedSignal$ QRL {{0}} {{1}} returned a Promise', // 46
'ComputedSignal is read-only', // 47
'WrappedSignal is read-only', // 48
'Attribute value is unsafe for SSR', // 49
];
let text = MAP[code] ?? '';
if (parts.length) {
Expand All @@ -77,7 +76,7 @@ export const codeToText = (code: number, ...parts: any[]): string => {
export const enum QError {
stringifyClassOrStyle = 0,
schedulerNotFound = 1,
UNUSED_2 = 2,
trackObjectWithoutProp = 2,
verifySerializable = 3,
UNUSED_4 = 4,
cannotRenderOverExistingContainer = 5,
Expand Down Expand Up @@ -124,8 +123,7 @@ export const enum QError {
computedNotSync = 46,
computedReadOnly = 47,
wrappedReadOnly = 48,
promisesNotExpected = 49,
unsafeAttr = 50,
unsafeAttr = 49,
}

export const qError = (code: number, errorMessageArgs: any[] = []): Error => {
Expand Down
Loading

0 comments on commit ec7e9b2

Please sign in to comment.