A react(typescript) project that uses Near api js works in dev but not preview mode

28 Views Asked by At

Am using a react project(typescript) with vite, the project interacts with a deployed sample donations smart contract.

The project works as expected in dev mode but once built and deployed I encounter the following error in the console.

enter image description here

I have tried altering the near API js dependency to a different version, but there is still an error. The repository to the project that am using is here

I have also tried renaming the default component names to custom component names.

when I comment out the near API js imports and code it works fine.

how do I resolve the error ?

0

There are 0 best solutions below