Cognite/Reveal: e.BufferGeometry is not a constructor TypeError: e.BufferGeometry is not a constructor
I’m using cognite/reveal and cognite/sdk for a project developed in react (18.x).
While connecting cognite/reveal with react application I’m encountering this error:
e.BufferGeometry is not a constructor
TypeError: e.BufferGeometry is not a constructor
I would like to know what is causing this error.
code attached below:-
A help to figure out the issue would be helpful.
Thank you,
Regards, Hariharan B P
Page 1 / 1
Hi Hariharan,
Thanks for your post. What application build system are you applying while using Reveal SDK, is it create-react-app or something else?
Regards,
Pramod
Hi Pramod,
Thank you for the response.
I’m using the create-react-app while using the Reveal SDK. On a side note, the reveal SDK integration is the last bit of the project that required to be done.
Regards,
Hariharan
Hi Hariharan,
Are you building the application on Linux system?
Regards,
Pramod S
Hi Pramod,
No, I’m building it on Windows based system
Regards,
Hariharan
Hi Hariharan,
Can you add below code into config-overrides.js file in root and check
Hi Pramod, Tried the solution but, the issue is persisting.
Regards,
Hariharan B P
Just to be sure, which version of react-app-rewired is used (refer your package.json file)
Best Regards,
Pramod S
Hi,
the version is:-
"react-app-rewired": "^2.2.1",
Which I presume is the latest.
Regards,
Hariharan
Hi Hariharan,
I have test create-react-app for typescript with Reveal SDK and it seems to work fine wiith the config-overrides.js changes. Below is the package.json file I am using to load my test application.
While looking into your package.json, is your application based on JavaScript not TypeScript?
Best Regards,
Pramod S
Hi Pramod,
Yes it is based on JavaScript.
I presume it wont be an issue while integrating.
Regards,
Hariharan
Hi Hariharan,
I find it hard to reproduce the issue in JavaScript application, can you share your config-overrides.js file or even better simple application with this issue.
Best Regards,
Pramod S
Hi, Pramod.
My apologies for the delay in response.
I have solved the BufferGeometry issue, apparently the react-app-wired was not the latest which is why the override was not working.
But, now when I try to connect to cognite/reveal using the project, appId and all other details. The server responds with
This api.cognitedata.com page can’t be found
I’m attaching the component’s source code from where I’m trying to connect to cognite. And I would appreciate if I can be enlightened with a way to work this out.
import React, { useEffect } from "react" import { Cognite3DViewer } from "@cognite/reveal" import { CogniteClient, CogniteAuthentication } from "@cognite/sdk"
import { getToken } from "../../utils/MsGraphApiCall"