PatrickAlphaC / hardhat-fund-me-fcc

82 stars 184 forks source link

yarn hardhat deploy --tags #3

Closed mubashirhussainkhadim closed 2 years ago

mubashirhussainkhadim commented 2 years ago
yarn run v1.22.18
warning package.json: No license field
warning ../../../package.json: No license field
$ '/Users/mubashirhussain/Desktop/course.ss/harhat Fund me/node_modules/.bin/hardhat' deploy --tags
Error HH306: The '--tags' parameter expects a value, but none was passed.

For more info go to https://hardhat.org/HH306 or run Hardhat with --show-stack-traces
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

00-deploy-mocks,js

const { network } = require("hardhat")

const DECIMALS = "8"
const INITIAL_PRICE = "200000000000" // 2000
module.exports = async ({ getNamedAccounts, deployments }) => {
    const { deploy, log } = deployments
    const { deployer } = await getNamedAccounts()
    const chainId = network.config.chainId
    // If we are on a local develohelppment network, we need to deploy mocks!
    if (chainId == 31337) {
        log("Local network detected! Deploying mocks...")
        await deploy("MockV3Aggregator", {
            contract: "MockV3Aggregator",
            from: deployer,
            log: true,
            args: [DECIMALS, INITIAL_PRICE],
        })
        log("Mocks Deployed!")
        log("------------------------------------------------")
        log(
            "You are deploying to a local network, you'll need a local network running to interact"
        )
        log(
            "Please run `npx hardhat console` to interact with the deployed smart contracts!"
        )
        log("------------------------------------------------")
    }
}
module.exports.tags = ["all", "mocks"]
PatrickAlphaC commented 2 years ago

Please format your issues, it makes them much easier to answer. Please see my edits so you can format in the future.

I'm also not sure what command you ran to get this error. What command did you run? It looks like you just didn't pass a tags parameter, like;

yarn hardhat deploy --tags all

Closing for now, feel free to follow up.

mubashirhussainkhadim commented 2 years ago

still got an error

mubashirhussain@Mubashirs-MBP harhat Fund me % yarn hardhat deploy --tags all yarn run v1.22.18 warning package.json: No license field warning ../../../package.json: No license field $ '/Users/mubashirhussain/Desktop/course.ss/harhat Fund me/node_modules/.bin/hardhat' deploy --tags all Nothing to compile An unexpected error occurred:

Error: ERROR processing skip func of /Users/mubashirhussain/Desktop/course.ss/harhat Fund me/deploy/00-deploy-mocks.js: ReferenceError: mmodule is not defined at Object. (/Users/mubashirhussain/Desktop/course.ss/harhat Fund me/helper-hardhat-config.js.js:17:1) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object. (/Users/mubashirhussain/Desktop/course.ss/harhat Fund me/deploy/00-deploy-mocks.js:2:38) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at DeploymentsManager.executeDeployScripts (/Users/mubashirhussain/Desktop/course.ss/harhat Fund me/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1101:15) at DeploymentsManager.runDeploy (/Users/mubashirhussain/Desktop/course.ss/harhat Fund me/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1053:16) at SimpleTaskDefinition.action (/Users/mubashirhussain/Desktop/course.ss/harhat Fund me/node_modules/hardhat-deploy/src/index.ts:409:5) at Environment._runTaskDefinition (/Users/mubashirhussain/Desktop/course.ss/harhat Fund me/node_modules/hardhat/src/internal/core/runtime-environment.ts:219:14) at Environment.run (/Users/mubashirhussain/Desktop/course.ss/harhat Fund me/node_modules/hardhat/src/internal/core/runtime-environment.ts:131:14) at SimpleTaskDefinition.action (/Users/mubashirhussain/Desktop/course.ss/harhat Fund me/node_modules/hardhat-deploy/src/index.ts:555:32) at Environment._runTaskDefinition (/Users/mubashirhussain/Desktop/course.ss/harhat Fund me/node_modules/hardhat/src/internal/core/runtime-environment.ts:219:14) at Environment.run (/Users/mubashirhussain/Desktop/course.ss/harhat Fund me/node_modules/hardhat/src/internal/core/runtime-environment.ts:131:14) at SimpleTaskDefinition.action (/Users/mubashirhussain/Desktop/course.ss/harhat Fund me/node_modules/hardhat-deploy/src/index.ts:640:5) at Environment._runTaskDefinition (/Users/mubashirhussain/Desktop/course.ss/harhat Fund me/node_modules/hardhat/src/internal/core/runtime-environment.ts:219:14) error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. mubashirhussain@Mubashirs-MBP harhat Fund me %

PatrickAlphaC commented 2 years ago
ReferenceError: mmodule is not defined