Skip to content

@gluonjs/core / packages/ssr/src/hydration / ComponentStyleHydrationError

Class: ComponentStyleHydrationError ​

Extends ​

  • Error

Constructors ​

Constructor ​

new ComponentStyleHydrationError(mismatch, message): ComponentStyleHydrationError

Parameters ​

mismatch ​

ComponentStyleHydrationMismatch

message ​

string

Returns ​

ComponentStyleHydrationError

Overrides ​

Error.constructor

Properties ​

code ​

readonly code: "GLUON_COMPONENT_STYLE_HYDRATION_MISMATCH" = 'GLUON_COMPONENT_STYLE_HYDRATION_MISMATCH'


mismatch ​

readonly mismatch: ComponentStyleHydrationMismatch

Example ​

Handle deterministic request-derived component carrier mismatches before client ownership changes:

ts
import {
  ComponentStyleHydrationError,
  type ComponentStyleHydrationMismatch,
} from '@gluonjs/ssr/hydration';

const mismatch: ComponentStyleHydrationMismatch = 'wrong-target';
const error = new ComponentStyleHydrationError(mismatch, 'The component carrier belongs to another ShadowRoot.');
console.error(error.code, error.mismatch);

Version-matched documentation. Examples are checked against the public package contracts.