Aurora

Solution…

Photo by Valou _c on Unsplash

Ever encountered this problem?

Solution —

Try running this command in your Terminal:

yarn config get prefix

You should see something similar to this →

/Users/<yourownname>/.npm-global

**Change <yourownname> to the name of the user on your MacBook/device.

Then, try running this in your Terminal →

export PATH=/Users/<yourownname>/.npm-global/bin:$PATH

Afterward, you might see that you could run this command successfully →

netlify deploy —-build --prod

You should be able to see similar outputs such as these —

✔ Finished uploading 40 assets
✔ Deploy is live!
Logs:
Unique Deploy URL:
Website URL:

--

--

The solution…

Photo by Brent Ninaber on Unsplash

Encountered this error output?

export ‘Provider’ (imported as ‘Provider’) was not found in ‘@project-serum/anchor’

Solution —

Change →

import { Program, Provider, web3 } from ‘@project-serum/anchor’;

To this →

import { Program, AnchorProvider, web3 } from ‘@project-serum/anchor’;

Then, amend this →

const getProvider = () => {      const connection = ...      const provider = new Provider(connection, ...);      return provider;}

Into this →

const getProvider = () => {      const connection = ...      const provider = new AnchorProvider(connection, ...);      return provider;}

If you still encounter errors in the output, try running this command →

yarn cache clean

--

--

The solution…

Photo by Dim Hou on Unsplash

Ever experienced this error, there are several ways to resolve this →

Property ‘Provider’ does not exist on type ‘typeof import(“/Users/... ... .../node_modules/@project-serum/anchor/dist/cjs/index”)’.ts(2339)

Solution —

Remove →

anchor.setProvider(anchor.Provider.env())

Change it to →

const provider = anchor.AnchorProvider.env();anchor.setProvider(provider)

Alternatively, you might want to try →

Removing —

import * as anchor from ‘@project-serum/anchor’

And replaced it with —

const anchor = require(‘@project-serum/anchor’)const provider = anchor.Provider.env();

--

--

The solution…

Photo by Chris Holder on Unsplash

Encountered this? You might want to try this →

Property 'wallet' does not exist on type 'Provider'.ts(2339)

Solution —

Change,

anchor.setProvider(anchor.Provider.env());

To these →

const provider = anchor.AnchorProvider.env();anchor.setProvider(provider);

You might see this output →

Property ‘Provider’ does not exist on type ‘typeof import(“/Users/... ... .../node_modules/@project-serum/anchor/dist/cjs/index”)’.ts(2339)

Then, change →

const program = anchor.workspace.Project as Program<Project>;

To →

const program = anchor.workspace.Project;

In VSCode, you will see under “Problems” that no problems have been detected in the workplace.

Alternatively, you can try →

import * as anchor from ‘@project-serum/anchor’

And replaced it with —

const anchor = require(‘@project-serum/anchor’)const provider = anchor.Provider.env();

--

--

The solution…

Photo by Ilya Babakov on Unsplash

Encountered this error? Try this —

Check your imports. You might have forgotten to import ‘Drawer’.

For instance,

import React, { useRef, useState } from ‘react’;import {Box, Divider, Drawer, IconButton, List, ListItemButton, Toolbar } from ‘@mui/material’;

You show see that the output is now error free. For example,

Compiled successfully!You can now view newproject in the browser.Note that the development build is not optimized.
To create a production build, use yarn build.
webpack compiled successfully

--

--

Aurora

Aurora

writer | contemporary | digital nomad | world citizen | founder | Add me on Session? Leave a comment on the post with your Session ID