Closed mvrahas closed 2 weeks ago
The first error line shows the error is coming from @solana/web3.js
. You may need polyfills to fix the issue, see https://github.com/oven-sh/bun/issues/1749#issuecomment-1374974179.
You can also use create-solana-dapp which should work out of the box.
I can't import Anchor into my freshly created React web app project. I get an error. Why is this happening? These are my steps to replicate below.
1) Create a new project
npx create-react-app test
2) Enter project directory and install Anchor
npm install @coral-xyz/anchor
(^0.30.0)3) Add a line to
App.js
to import Anchorimport * as anchor from "@coral-xyz/anchor"
4) Run the project
npm run start
5) Open
http://localhost:3000
in Safari browser6) Observe error in the browser