@gluonjs/ssr / 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
readonlycode:"GLUON_COMPONENT_STYLE_HYDRATION_MISMATCH"='GLUON_COMPONENT_STYLE_HYDRATION_MISMATCH'
mismatch
readonlymismatch:ComponentStyleHydrationMismatch
Example
Handle deterministic request-derived component carrier mismatches before client ownership changes:
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);