# "loaderror" event

> Our window could not be loaded or reached (network, Content Security Policy, an origin not registered for the key).

Source: https://docs.tryyoursize.com/reference/web/event-loaderror/

*Event* · `@tryyoursize/sdk`

Our window could not be loaded or reached (network, Content Security Policy, an origin not registered for the key).

```ts
loaderror: { elementType: ElementType; error: TryYourSizeError };
```

## Payload

- **`elementType`** (`"fit" | "button" | "sizeGuide"`, required): Which element.
- **`error`** (`TryYourSizeError`, required): Code `window_unreachable`. See [Web SDK errors](https://docs.tryyoursize.com/sdk/errors.md#window_unreachable).

## Example

**JavaScript**

```js
guide.on("loaderror", ({ error }) => {
  console.warn(error.code, error.docUrl);
  guide.unmount(); // fall back to your own size chart
});
```

**React**

```tsx
<SizeGuide product="SKU-123" onLoadError={({ error }) => report(error.code)} />
```
