GithubHelp home page GithubHelp logo

alchemyplatform / create-web3-dapp Goto Github PK

View Code? Open in Web Editor NEW
861.0 39.0 255.0 7.23 MB

The complete toolbox to create web3 applications.

Home Page: https://docs.alchemy.com

License: GNU Affero General Public License v3.0

JavaScript 5.41% TypeScript 94.59%
create-next-app create-web3 ethers nextjs react scaffoldeth solidity web3 web3js alchemysdk

create-web3-dapp's Introduction

Create Web3 DApp



Everything you need to create Web3 Dapps in 4 minutes.

Stargazers Forks Contributors Issues MIT License

This package includes the global command to start the Create Web3 DApp CLI builder.

Please refer to this package's documentation and the following links for an in depth explanation:

  • Docs - Everything you need to know when using CW3D
  • GitHub - look at the extensive code example or start contributing
  • Website - Learn more about CW3D and add components to your project
  • Templates - Check out the pre-built project templates
  • Components Library - Add features directly to your project through components
  • Examples - See the components implemented in a real world dapp
  • Community - Meet other builders, get support, and give feedback!

🟡 No need to clone: run "npx create-web3-dapp@latest" in your terminal to get started


What's included?

Your environment will have everything you need to start building a dapp:

  • Next.js
  • Wagmi Hooks
  • Ethers.js
  • Rainbowkit
  • Alchemy SDK

Supported chains

With create-web3-dapp you can create multi-chain dapps supporting all of the major EVM based chains:

  • Ethereum
  • Polygon
  • Polygon zkEVM
  • Arbitrum
  • Optimism

Support for non EVM chains is in the roadmap


What is create-web3-dapp?

create-web3-dapp is an npx tool that allows developers to create web3 applications in ~4 minutes.

The dapp created with create-web3-dapp are NextJS-based, and compatible with the most used blockchains such as Ethereum, Polygon, Optimism, Arbitrum, and Solana. Create-web3-dapp allows web3 developers to build production-ready decentralized applications at lightning speed, using pre-made React components, webhooks, and APIs.

No complicated configuration or folder structures, only the files you need to build your Dapp.

templates


Philosophy

  • One Dependency: There is only one build dependency. It uses webpack, Babel, ESLint, and other amazing projects, but provides a cohesive curated experience on top of them.

  • No Configuration Required: You don't need to configure anything. A reasonably good configuration of both development and production builds is handled for you so you can focus on writing code.

  • No Lock-In: You can “eject” to a custom setup at any time. Run a single command, and all the configuration and build dependencies will be moved directly into your project, so you can pick up right where you left off.

When to use CW3D

Create web3 dapp is a great fit for:

  • Learning Web3 in a comfortable and feature-rich development environment.
  • Starting new Web3 Applications
  • Testing things and experiment with React for your libraries and components.

Usage

npx create-web3-dapp@latest

If you've previously installed create-web3-dapp globally via npx create-web3-dapp, the CLI builder will notify you if a new version has been released. In any case, we suggest you to run using the latest available version by running npx create-web3-dapp@latest.

(npx comes with npm 5.2+ and higher, see instructions for older npm versions)


Quick Start

To create a new app:

  1. In your terminal run:
  npx create-web3-dapp@latest
  1. Select and create the dependencies, components, and contracts you want to include in your web3 application.

Create web3 dapp will then create a directory containing the files to kickstart your project and install the install dependencies you'll need

npx create-web3-dapp@latest
cd my-create-web3-dapp
npm run dev

In case you've installed a blockchain development environment, navigate to the frontend folder before running npm run dev.

Now navigate on http://localhost:3000/ to see your dapp.

Next, learn how to add a web3 ready component from the create-web3-dapp library.


Smart Contracts Backpack - CLI Smart Contract creator

Create web3 dapp doesn't only set up your blockchain development environment, that to the built-in smart contracts backpack it also allows to create fully fledged Solidity Smart Contracts directly from the CLI.

Note: This will work only if you have installed a blockchain development environment

The smart contracts backpack can create audited smart contracts, deployment scripts and tests, of one of the following standards:

  • ERC721: NFT collection smart contract
  • ERC20: Crypto currency smart contract
  • ERC1155: Fungibility agnosting smart contract

Learn more on how to create, build and deploy, the smart contracts backpack in the docs.


Web3 React Components Library

Create web3 dapp allows developers to prototype their dapps in minutes thanks to a full library of responsive, production ready, web3 React components.

Note: The components work best inside create-web3-dapp projects, but are compatible with any NextJS project.

Use the following links to learn how to implement the components in the library:

  • Docs: a brokendown guide for every component
  • Github: see the components implemented in a real-world project

component


Example implementation:

  1. In /components create nftCreator.jsx
  2. In/styles create NftCreator.module.css
  3. In /pages/apicreatepinFileToIpfs.jspinJsonToIpfs.js
  4. Copy the corresponding code below into each of the created files above.
  5. Import the NftCreator component at the top of your page:

import styles from "../styles/Home.module.css";
import NftCreator from "../components/nft-creator";
import contract from "../abis/smartContractAbi.json";

export default function Home() {
	return (
		<div>
			<main className={styles.main}>
				<NftCreator
					abi={contract.abi}
					contractAddress={
						"0x9FaCAf075Cda7C0947DA0F0B4164332e01422E97"
					}
				/>
			</main>
		</div>
	);
}

More components? Check detailed instructions on the Docs.


Dapp Templates Library

Create web3 dapp gives you access to a library of production ready, web3 applications to kickstart your project with. NFTs Explorer, and much more coming soon.

The templates are available for developers to use as is, or they can be customized to fit the needs of their particular project.

Note: keeping dependencies to the minimum, and the code lean is our top priority, this to grant the templates, full customisability.

Use the following links to learn how to kickstart your dapp using the templates library:


templates



Folder Structure

create-web3-dapp has two folders structures, based on the presence of a blockchain development environment, or not.

With Blockchain Development Environment

📦Root
 ┣ 📂components
 ┃ ┣ 📂navigation
 ┃ ┃ ┗ 📜navbar.jsx
 ┃ ┗ 📜InstructionsComponent.jsx
 ┣ 📂layout
 ┃ ┗ 📜mainLayout.jsx
 ┣ 📂pages
 ┃ ┣ 📂api
 ┃ ┣ 📜_app.js
 ┃ ┗ 📜index.jsx
 ┣ 📂public
 ┃ ┗ 📜alchemy_logo.svg
 ┣ 📂styles
 ┃ ┣ 📜Home.module.css
 ┃ ┣ 📜Navbar.module.css
 ┃ ┣ 📜InstructionsComponent.module.css
 ┃ ┗ 📜globals.css
 ┣ 📜.env.local
 ┣ 📜.gitignore
 ┣ 📜next.config.js
 ┣ 📜package-lock.json
 ┗ 📜package.json

Without Blockchain Development Environment

📦Root
 ┣ 📂.vscode
 ┃ ┗ 📜settings.json
 ┣ 📂backend
 ┃ ┣ 📂contracts
 ┃ ┃ ┗ 📜MyContract.sol
 ┃ ┣ 📂scripts
 ┃ ┃ ┗ 📜MyContract_deploy.js
 ┃ ┣ 📂test
 ┃ ┃ ┗ 📜Lock.js
 ┃ ┣ 📜.env.local
 ┃ ┣ 📜hardhat.config.js
 ┃ ┣ 📜package-lock.json
 ┃ ┗ 📜package.json
 ┣ 📂frontend
 ┃┣ 📂components
 ┃ ┃┣ 📂navigation
 ┃ ┃ ┗ 📜navbar.jsx
 ┃  ┃┗ 📜InstructionsComponent.jsx
 ┃┣ 📂layout
 ┃┃ ┗ 📜mainLayout.jsx
 ┃┣ 📂pages
 ┃┃ ┣ 📂api
 ┃┃ ┣ 📜_app.js
 ┃┃ ┗ 📜index.jsx
 ┃┣ 📂public
 ┃┃ ┗ 📜alchemy_logo.svg
 ┃┣ 📂styles
 ┃┃ ┣ 📜Home.module.css
 ┃┃ ┣ 📜Navbar.module.css
 ┃┃ ┣ 📜InstructionsComponent.module.css
 ┃┃ ┗ 📜globals.css
 ┃┣ 📜.env.local
 ┃┣ 📜.gitignore
 ┃┣ 📜next.config.js
 ┃ ┣ 📜package-lock.json
 ┃ ┗ 📜package.json
 ┣ 📜.DS_Store
 ┣ 📜.env.local
 ┣ 📜.gitignore
 ┣ 📜LICENSE
 ┗ 📜README.md

Contributing

We'd love to have your helping hand on create-web3-dapp! See contributing.md for more information on what we're looking for and how to get started.

Supporting Create Web3 DApp

Create Web3 DApp is a community maintained project and all contributors are volunteers. If you'd like to support the future development of Create React App then please consider donating to our Open Collective.

Tools to try with create web3 dapp:

  • coming soon - partners.

Credits

This project exists thanks to all the people who contribute.


Maintainers


License

Create React App is open source software licensed as GNU-AGPL.

create-web3-dapp's People

Contributors

anishde12020 avatar arihantbansal avatar curiouslycory avatar cytronicoder avatar danielschwartz4 avatar dicethedev avatar elanh avatar eversmile12 avatar hussainzz avatar kenryu42 avatar kunal232i avatar oceans404 avatar omgmanu avatar rkueny avatar steveluscher avatar technophile-04 avatar thatguyintech avatar xscottxbrownx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

create-web3-dapp's Issues

Web3

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Dapp

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

initial `npm run dev` error in loading `./Navbar.module.css`

Describe the bug
After running npx create-web3-dapp@latest I am getting this error when I cd <my-project> && npm run dev for the first time

Screenshot from 2023-07-18 23-44-41

I inspected the file and the name of the module imported is wrong.

Screenshot from 2023-07-18 23-45-54

Reproducing the bug
I followed the Create Web3 Dapp Quickstart guide and at step 5 Do you want to create a smart contract?, I selected No and continued with the steps.

Solution
Renaming the file from navbar.module.css to Navbar.module.css runs the site properly

npx create-web3-dapp@latest throw error Cannot read properties of null (reading 'pickAlgorithm')

npx create-web3-dapp@latest throw an error
npm ERR! Cannot read properties of null (reading 'pickAlgorithm')

The full log ->

npm ERR! Cannot read properties of null (reading 'pickAlgorithm')

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ankus\AppData\Local\npm-cache_logs\2023-03-24T08_42_18_398Z-debug-0.log
Error: Command failed: npm install --loglevel=error
npm ERR! Cannot read properties of null (reading 'pickAlgorithm')

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ankus\AppData\Local\npm-cache_logs\2023-03-24T08_42_18_398Z-debug-0.log

Next build failed and some folder structure related questions

Just finished the week 3 of road to web3 project by using create-web3-app.
https://github.com/kenryu42/chain-battles-create-web3-dapp

Here is a list of the bugs / questions I encountered.

Bugs

  1. Running npx create-web3-dapp will prompt you twice to enter the details. #17
  2. Running next build throws the following error:

Build optimization failed: found pages without a React Component as default export

Questions

  1. Hardhat related packages are installed in the root directory, but I can't run hardhat commands from the root directory. What is the recommended way to use hardhat in this folder structure?
  2. Most full-stack app I've seen separate the back-end and front-end folders.
    Shouldn't we keep the backend and frontend folders separate?
  3. Is there a use case that requires the use of a private key on the front end? If no maybe we should remove the NEXT_PUBLIC_PRIVATE_KEY from .env.

Three errors when installing latest version of create-web3-dapp

Describe the bug
When following the directions in the Quick Start, I get the following three errors on a fresh install:

  1. After creating a new app, I get Error: ENOENT: no such file or directory, mkdir 'pages/api'
image
  1. After the app is created, and I run npm run dev, I get
Error: > The `app` directory is experimental. To enable, add `appDir: true` to your `next.config.js` configuration under `experimental`. See https://nextjs.org/docs/messages/experimental-app-dir-config
image

I can move past this by updating next.config.js to

/** @type {import('next').NextConfig} */

module.exports = {
 reactStrictMode: false,
 webpack: (config) => {
   config.resolve.fallback = { fs: false, net: false };
   return config;
 },
 experimental: { appDir: true },
};
  1. If I run npm run dev again, I get the following the in browser:
image and this in the terminal: image

To Reproduce
Steps to reproduce the behavior:

  1. Run npx create-web3-dapp@latest
  2. Choose how to start: › Create default full-stack dapp
  3. Choose your chain › Polygon
  4. Do you already have an Alchemy account yes
  5. Insert your Alchemy API Key
  6. Get Error: ENOENT: no such file or directory, mkdir 'pages/api'
  7. Run cd my-create-web3-dapp && npm run dev
  8. Get Error: > The appdirectory is experimental. To enable, addappDir: trueto yournext.config.jsconfiguration underexperimental.

Expected behavior
Expect no errors when installing fresh version of the dapp

Screenshots
See above

Desktop (please complete the following information):

  • OS: iOS
  • Browser: Chrome

[BUG] Installation in vscode not working receiving below error - Please help.

warn - Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/messages/fast-refresh-reload
error - utils\walletSetup.js (12:2) @ chain
error - TypeError: Cannot read properties of undefined (reading 'mainnet')
at eval (webpack-internal:///./utils/walletSetup.js:27:46)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
page: '/'
}
10 | export const { chains, provider } = configureChains(
11 | [

12 | chain.mainnet,
| ^
13 | chain.goerli,
14 | chain.polygonMumbai,
15 | chain.polygon,
TypeError: Cannot read properties of undefined (reading 'mainnet')
at eval (webpack-internal:///./utils/walletSetup.js:27:46)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
page: '/'

Error with NFT Explorer template

When using create-web3-test1 to create the NFT Template I ran into two issues ...

$ npx create-web3-dapp@latest
...
✔ Project name … create-web3-test1
✔ Choose how to start: › Create pre-built template
✔ Select a template › NFT Explorer
...
$ cd create-web3-test1 && npm run dev

> [email protected] dev
> next dev

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info  - Loaded env from /home/sum/DEV/ETH/0x-Exchange/create-web3-test1/.env.local
error - ./components/navigation/navbar.jsx:1:0
Module not found: Can't resolve '@rainbow-me/rainbowkit'
> 1 | import { ConnectButton } from "@rainbow-me/rainbowkit";
  2 | import styles from "../../styles/Navbar.module.css";
  3 | export default function Navbar() {
  4 | 	return (

Import trace for requested module:
./layout/mainLayout.jsx
./pages/_app.js

https://nextjs.org/docs/messages/module-not-found

fixed that with npm i @rainbow-me/rainbowkit

Started the App and got this error

$ npm run dev

> [email protected] dev
> next dev

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info  - Loaded env from /home/sum/DEV/ETH/0x-Exchange/create-web3-test1/.env.local
event - compiled client and server successfully in 6.2s (1373 modules)
wait  - compiling...
event - compiled client and server successfully in 476 ms (1373 modules)
wait  - compiling / (client and server)...
event - compiled client and server successfully in 570 ms (1384 modules)
wait  - compiling /_error (client and server)...
error - pages/_app.js (39:33) @ eval
error - TypeError: (0 , wagmi__WEBPACK_IMPORTED_MODULE_4__.createClient) is not a function
    at eval (webpack-internal:///./pages/_app.js:50:72) {
  page: '/'
}
  37 | });
  38 | 
> 39 | const wagmiClient = createClient({
     |                                 ^
  40 | 	autoConnect: true,
  41 | 	connectors,
  42 | 	provider,
event - compiled client and server successfully in 305 ms (1385 modules)
TypeError: (0 , wagmi__WEBPACK_IMPORTED_MODULE_4__.createClient) is not a function
    at eval (webpack-internal:///./pages/_app.js:50:72)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
TypeError: (0 , wagmi__WEBPACK_IMPORTED_MODULE_4__.createClient) is not a function
    at eval (webpack-internal:///./pages/_app.js:50:72)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Add GitHub Actions

I suggest having GitHub actions for linting when code is pushed or PR is merged on main branch.

It would be a simple workflow which runs npm run lint on the code. We can also look into allowing PRs to merge only when lint is successful.

Conflicts between ESLint and Prettier

Current plugins in ESLint have the no-mixed-spaces-and-tabs rule. If this rule isn't followed in the code, the error is thrown.
image

However, even after fixing it manually, yarn prettier --write returns it to the previous state.
Thus, we are never able to lint the code locally and to send it then to the repo without any possible ESlint errors.

Possible workaround:

Override the rule. (not recommended, because there can be another conflicts in the future)

Wait until #44 is resolved and the consistent coding style is accepted. (may take too long)

  1. Remove Prettier entirely (can be replaced with some consistent styling after #44, I've proposed Airbnb here);
  2. Create separate script like npm run lint:fix, which will invoke the ESlint with the argument --fix;
  3. Basic npm run lint will be used for the checks in pipelines - see #43.

I guess this issue can be a great and non-painful way to start the whole linting enhancement.

Foundry addition

We can start adding foundry support from here.

Looking at some of the possible ways to integrate it. Anyone else can help out if they want :)

Addition of ENS names for a wallet address

Just like an owner can fetch his/her own NFTs, we can also add the option to check all the ENS names registered under the owner's wallet address that can be fetched using Alchemy SDK.

image

Solana quickstart flow should have its own tooling options

Currently, the dapp wizard has the same flow for EVM vs. Solana projects. We should add Solana-specific flow.

🔵 Welcome to the create-web3-dapp wizard 🔵


✔ Please, insert a project name … solana-dapp
solana-dapp
✔ For which VM are you building for? › Solana
✔ Do you want to import the template files? … no / yes
✔ Do you want to import a Blockchain Development environment? … no / yes
? Choose a Blockchain development environment › - Use arrow-keys. Return to submit.
❯   Hardhat
    Foundry

Screen Shot 2022-08-09 at 12 52 02 PM

Error: spawn npm ENOENT

When I run npx create-web3-dapp@latest, throw an error:

image

  • OS: Windows10
  • Terminal: CMD / Git Bash / PowerShell
  • Node.js: 18.15.0

False Type declaration

Describe the bug
A clear and concise description of what the bug is.
In helper/core/workflows/standardWorkflow at the line 87, these errors occurs
Don't use Number as a type. Use number instead & Don't use String as a type. Use string instead

To Reproduce
Steps to reproduce the behavior:

  1. Go to helper/core/workflows/standardWorkflow
  2. Go to the line 87 -> const template: Number | String = await prompts
  3. See error

Screenshots
If applicable, add screenshots to help explain your problem.
Screenshot (86)

Additional context
Add any other context about the problem here.
Solution
const template: Number | String = await prompts -> const template: number | string = await prompts

The highlight option will not change

When I run npx create-web3-dapp@latest, and choose how to start:

  • Create default full-stack dapp
  • Create pre-built template
  • Back

And I press Up or Down on keyboard, the highlight option will not change.

image

The highlight option is always the 1st one. But it still work after press ENTER.

  • OS: Windows10
  • Terminal: Git Bash
  • Git Version: 2.38.1.windows.1

Errors after fresh Install of template and new dapp

After creating a new dapp with npx create-web3-dapp@latest there are hundreds of API requests that fail.

Selected Ethereum, and Test net in the wizard for both.

dapp template
Screenshot 2023-03-17 at 10 50 33 PM

dapp with no Template
Screenshot 2023-03-17 at 10 52 21 PM

related to API request for eth_getBalance and eth_blockNumber

NFT explorer has runtime error

Followed this 2 min tutorial from Alchemy's Youtube
Message in terminal:

error - ./pages/_app.js:5:0
Module not found: Can't resolve 'wagmi'
3 |
4 | import { getDefaultWallets, RainbowKitProvider } from "@rainbow-me/rainbowkit";

5 | import { configureChains, createClient, WagmiConfig } from "wagmi";
6 | import {
7 | mainnet,
8 | polygon,

[ENHANCEMENT] Issue templates

GitHub issue templates can help contributors with issue labels, title prefixes (maybe not needed at all because of labelling), npm and node version, the overall issue structure, making sure they've read contributing.md, etc.

Check for new version of create-web3-dapp on each new run

A common issue (especially since this package is being iterated on so rapidly) is that old versions may break due to shifting dependencies and architecture within the package.

We should run a check on npx create-web3-dapp to see if there are any new versions to install before proceeding with the rest of the script.

Help with testing locally

i am trying to contribute some changes, but have some hard time testing changes locally, never used parcel before.
i saw the package.json has two scripts.

yarn start
yarn build
yarn build index.ts
these all three are failing
how can i exactly test these locally ?

"scripts": {
                "test": "echo \"Error: no test specified\" && exit 1",
                "lint": "eslint . --ext .ts && yarn prettier --write .",
                "start": "parcel index.html",
                "build": "parcel build ./dist/index.js"
        }

Error after fresh install selecting NFT Explorer and run

Describe the bug
I run the setup command and received an error that prevents site to launch. No changes were made to project.
Workaround at the end

To Reproduce
Steps to reproduce the behavior:

  1. run the installation script:
    $ npx create-web3-dapp@latest
    then select:
    ✔️ Project name … my-create-web3-dapp
    ✔️ Choose how to start: › Create pre-built template
    ✔️ Select a template › NFT Explorer
    ✔️ Choose your chain › Arbitrum
    ✔️ Choose your network › Testnet
    ✔️ Do you already have an Alchemy account? … no / [yes]
    ✔️ Insert your Alchemy API Key (Copy from https://auth.alchemy.com/?a=create-web3-dapp): … [Valid key here]

  2. Then run the site
    $ cd my-create-web3-dapp && npm run dev

Error received:

TypeError: Cannot read properties of undefined (reading 'config')

full output:

> [email protected] dev
> next dev

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
error - ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[3].oneOf[4].use[1]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[3].oneOf[4].use[2]!./styles/Navbar.module.css
TypeError: Cannot read properties of undefined (reading 'config')
Import trace for requested module:
./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[3].oneOf[4].use[1]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[3].oneOf[4].use[2]!./styles/Navbar.module.css
./styles/Navbar.module.css
./components/navigation/navbar.jsx
./layout/mainLayout.jsx

Expected behavior
Should show default NTF Explorer site

Screenshots

Desktop (please complete the following information):

  • OS: Linux Fedora 37

  • Browser chrome

  • Version Version 111.0.5563.64 (Official Build) (64-bit)

  • npm -v && node -v
    9.3.1
    v18.14.1

Additional context
I can fix this manually following this instruction tailwindlabs/tailwindcss#6393 (comment)

Error: spawn npm ENOENT

Dependencies are not installing on the go
on running npx create-web3-dapp@latest every thing is good until it starts installing dependencies

Found a similar error on Stackoverflow

Here is the image of my console
image

Git ignore

Currently, the .gitignore files only contain .env.local
It would be great if they both matched the default hardhat & Next.js installs

Add the possibility to use the chain Sepolia

Is your feature request related to a problem? Please describe.
When trying to use the chain Sepolia, this error occurs:

app-index.js:32 ChainDoesNotSupportContract: Chain "Sepolia" does not support contract "ensUniversalResolver".

This could be due to any of the following:
- The chain does not have the contract "ensUniversalResolver" configured.

Describe the solution you'd like
I would like to be able to use the chain Sepolia.

Describe alternatives you've considered
For the moment I have to use the chain Goerli.

Additional context
I simply init the app with npx create-web3-dapp@latest
then I modified frontend/app/layout.tsx like this:

"use client";
import { WagmiConfig, createConfig, sepolia } from "wagmi";
import { ConnectKitProvider, getDefaultConfig } from "connectkit";
import Navbar from "@/components/instructionsComponent/navigation/navbar";
import Footer from "@/components/instructionsComponent/navigation/footer";
import { goerli } from "viem/chains";

const config = createConfig(
  getDefaultConfig({
    // Required API Keys
    alchemyId: process.env.ALCHEMY_API_KEY, // or infuraId
    walletConnectProjectId: process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID!,

    // Required
    appName: "You Create Web3 Dapp",

    // Optional
    appDescription: "Your App Description",
    appUrl: "https://family.co", // your app's url
    appIcon: "https://family.co/logo.png", // your app's logo,no bigger than 1024x1024px (max. 1MB)

    // ChainDoesNotSupportContract: Chain "Sepolia" does not support contract "ensUniversalResolver".
    // This could be due to any of the following:
    // - The chain does not have the contract "ensUniversalResolver" configured.
    chains: [sepolia],
    // chains: [goerli],
  })
);

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en">
      <WagmiConfig config={config}>
        <ConnectKitProvider mode="dark">
          <body>
            <div style={{ display: "flex", flexDirection: "column", minHeight: "105vh" }}>
              <Navbar />
              <div style={{flexGrow: 1}}>{children}</div>
              <Footer />
            </div>
          </body>
        </ConnectKitProvider>
      </WagmiConfig>
    </html>
  );
}

folders delete themselves after installing create-web-3-dapp

I tried to install create-web-3-dapp according to guidelines.

As soon as the installation finishes, I can see folders "backend" and "frontend".
Within seconds those folders are deleted again and I am left with an empty folder.
Didn't click anything.

Anyone a clue what I might be doing wrong?

Issue with localhost provider

Describe the bug
Using hardhat local node and metamask, Configuring Wagmi client with jsonRpcProvider,
Error I am getting is networkConfigurationId undefined does not match a configured networkConfiguration
To Reproduce
Steps to reproduce the behavior:

  1. Replace the content of _app.js of frontend folder with the following code.
  2. Run npx hardhat node in backend folder
  3. Run npx run dev in frontend folder
  4. Select localhost network in metamask
  5. Try to connect with connect
import "../styles/globals.css";
import "@rainbow-me/rainbowkit/styles.css";

import { getDefaultWallets, RainbowKitProvider } from "@rainbow-me/rainbowkit";
import { configureChains, createClient, useAccount, WagmiConfig } from "wagmi";
import {
  localhost,
} from "wagmi/chains";
import { alchemyProvider } from "wagmi/providers/alchemy";
import { publicProvider } from "wagmi/providers/public";
import MainLayout from "../layout/mainLayout";
import { useRouter } from "next/router";
import { jsonRpcProvider } from "@wagmi/core/providers/jsonRpc";

const { chains, provider } = configureChains(
  [
    localhost
  ],
  [
    jsonRpcProvider({
      rpc: (chain) => ({
        http: `http://127.0.0.1:8545/`,
      }),
    }),
  ]
);

console.log(chains, provider);

const { connectors } = getDefaultWallets({
  appName: "My Alchemy DApp",
  chains,
});

const wagmiClient = createClient({
  autoConnect: true,
  connectors,
  provider,
});

export { WagmiConfig, RainbowKitProvider };

function MyApp({ Component, pageProps }) {
  const router = useRouter();
  const account = useAccount({
    onConnect({ address, connector, isReconnected }) {
      console.log(address);
      if (!isReconnected) router.reload();
    },
  });
  return (
    <WagmiConfig client={wagmiClient}>
      <RainbowKitProvider
        modalSize="compact"
        initialChain={process.env.NEXT_PUBLIC_DEFAULT_CHAIN}
        chains={chains}
      >
        <MainLayout>
          <Component {...pageProps} />
        </MainLayout>
      </RainbowKitProvider>
    </WagmiConfig>
  );
}


Expected behavior
App should connect with wallet and show address.

Screenshots
Screenshot 2023-05-14 at 2 14 44 PM

Desktop (please complete the following information):

  • OS: MacOS ventura 13.4
  • Browser Charome

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Upgrade Git ignore

Currently, the .gitignore files only contain .env.local. It would be great if node-modules & package-lock.json had also been added here.

[ENHANCEMENT] - Make the nft contract address an actual link in the NFT Card component

Within the NFT Gallery > NFT Card that gets created for each nft in the wallet that is searched.

The etherscan contract address and etherscan logo should be wrapped in an <a> to create a link to it.

The css for this already has the cursor set to pointer, but it is not a link to the etherscan contract address (like it seemingly should be, as there's an etherscan logo right next to it as well.)

Screenshot 2023-03-02 at 5 18 49 PM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.