iTwin / viewer

Monorepo that contains the iTwin Viewer npm packages and their related packages
MIT License
24 stars 15 forks source link

Maximum call stack size exceeded when localization is supplied #224

Closed roluk closed 1 year ago

roluk commented 1 year ago

Mounting this MyViewerComponent produces the following error:

import { ITwinLocalization } from "@itwin/core-i18n";
import { Viewer } from "@itwin/web-viewer-react";

function MyViewerComponent(): ReactElement {
  const [localization] = useState(() => new ITwinLocalization());
  return (
    <Viewer
      authClient={authClient}
      enablePerformanceMonitors={true}
      iTwinId={iTwinId}
      iModelId={iModelId}
      localization={localization}
    />
  );
}
Uncaught RangeError: Maximum call stack size exceeded
    at Function.keys (<anonymous>)
    at isEqual6 (index.ts:43:24)
    at isEqual6 (index.ts:53:26)
    at isEqual6 (index.ts:53:26)
    at isEqual6 (index.ts:53:26)
    at isEqual6 (index.ts:53:26)
    at isEqual6 (index.ts:53:26)
    at isEqual6 (index.ts:53:26)
    at isEqual6 (index.ts:53:26)
    at isEqual6 (index.ts:53:26)

When localization is not supplied through props, this error doesn't reproduce.

Environment: