tablelandnetwork / tableland-js

Mono-repo containing Tableland JS libraries and tools
13 stars 1 forks source link

TypeError: Cannot read properties of undefined (reading 'push') [ethOnline-hackathon-urgent] #55

Closed bitsandtea closed 1 year ago

bitsandtea commented 1 year ago

Describe the bug Cannot run local-tableland in my OSX machine

To Reproduce Steps to reproduce the behavior: npm install @tableland/local@^2.0.2" or npm install @tableland/local@latest

Expected behavior Local Tableland to launch

Screenshots

[Registry] An unexpected error occurred:
[Registry] TypeError: Cannot read properties of undefined (reading 'push')
[Registry] at extendEnvironment (/Users/myname/Desktop/Dev/oneclickdapp-ethonline/node_modules/hardhat/src/internal/core/config/config-env.ts:141:28)
[Registry] at Object.<anonymous> (/Users/myname/Desktop/Dev/oneclickdapp-ethonline/node_modules/@nomiclabs/hardhat-ethers/src/internal/index.ts:27:18)
[Registry] at Module._compile (node:internal/modules/cjs/loader:1256:14)
[Registry] at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
[Registry] at Object.require.extensions.<computed> [as .js] (/Users/myname/Desktop/Dev/oneclickdapp-ethonline/node_modules/ts-node/src/index.ts:1608:43)
[Registry] at Module.load (node:internal/modules/cjs/loader:1119:32)
[Registry] at Function.Module._load (node:internal/modules/cjs/loader:960:12)
[Registry] at Module.require (node:internal/modules/cjs/loader:1143:19)
[Registry] at require (node:internal/modules/cjs/helpers:119:18)
[Registry] at Object.<anonymous> (/Users/myname/Desktop/Dev/oneclickdapp-ethonline/node_modules/@nomicfoundation/hardhat-chai-matchers/src/index.ts:1:1)

Desktop (please complete the following information):

"devDependencies": {
    "@nomicfoundation/hardhat-toolbox": "2.0.0",
    "@nomiclabs/hardhat-ethers": "2.2.1",
    "@openzeppelin/contracts-upgradeable": "4.8.0",
    "@openzeppelin/hardhat-upgrades": "1.21.0",
    "@tableland/evm": "^4.3.0",
    "@tableland/local": "^2.0.2",
    "@typechain/hardhat": "6.1.5",
    "dotenv": "16.0.3",
    "erc721a-upgradeable": "4.2.3",
    "hardhat": "^2.18.2",
    "hardhat-gas-reporter": "1.0.9",
    "prettier": "2.8.1",
    "prettier-plugin-solidity": "1.1.0",
    "solidity-coverage": "0.8.2"
  }
joewagner commented 1 year ago

Hey @bitsandtea sorry to hear you're having trouble. I'm not sure if its a typo in your issue, but @tableland/local2 is not a project.
If you try npm install @tableland/local then npx local-tableland does that work?

Side note: this repository is no longer being used, I'm going to transfer this issue to our new repo.

bitsandtea commented 1 year ago

That was a typo I fixed it @joewagner

dtbuchholz commented 1 year ago

adding more context via some convos we had in discord. note: i wasnt able to reproduce this on my end, so it might be an isolated instance. not sure.

-- after uninstalling and reinstalling @tableland/local globally, the issue appears to persist. the following is shown in the logs:

[Registry] Please run: npm install --save-dev "@nomicfoundation/hardhat-network-helpers@^1.0.0" "@nomicfoundation/hardhat-chai-matchers@^1.0.0" "@nomiclabs/hardhat-etherscan@^3.0.0" "@types/chai@^4.2.0" "@types/mocha@>=9.1.0" "@typechain/ethers-v5@^10.1.0" "@typechain/hardhat@^6.1.2" "chai@^4.2.0" "hardhat-gas-reporter@^1.0.8" "solidity-coverage@^0.8.1" "typechain@^8.1.0"

the user shouldn't have to update these deps, but just to see what happens, they installed all of these with npm install --save-dev:

npm install --save-dev "@nomicfoundation/hardhat-network-helpers@^1.0.0" "@nomicfoundation/hardhat-chai-matchers@^1.0.0" "@nomiclabs/hardhat-etherscan@^3.0.0" "@types/chai@^4.2.0" "@types/mocha@>=9.1.0" "@typechain/ethers-v5@^10.1.0" "@typechain/hardhat@^6.1.2" "chai@^4.2.0" "hardhat-gas-reporter@^1.0.8" "solidity-coverage@^0.8.1" "typechain@^8.1.0"

then, it continues asking for more dep updates:

up to date, audited 685 packages in 1s

128 packages are looking for funding
  run `npm fund` for details

2 moderate severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
ditegashi@Dites-MacBook-Pro tablelandexample % npx local-tableland
[Registry] Error HH801: Plugin @nomicfoundation/hardhat-toolbox requires the following dependencies to be installed: @nomicfoundation/hardhat-network-helpers, @nomicfoundation/hardhat-chai-matchers, @nomiclabs/hardhat-etherscan, @types/chai, @types/mocha, @typechain/ethers-v5, @typechain/hardhat, chai, hardhat-gas-reporter, solidity-coverage, typechain.
[Registry] Please run: npm install --save-dev "@nomicfoundation/hardhat-network-helpers@^1.0.0" "@nomicfoundation/hardhat-chai-matchers@^1.0.0" "@nomiclabs/hardhat-etherscan@^3.0.0" "@types/chai@^4.2.0" "@types/mocha@>=9.1.0" "@typechain/ethers-v5@^10.1.0" "@typechain/hardhat@^6.1.2" "chai@^4.2.0" "hardhat-gas-reporter@^1.0.8" "solidity-coverage@^0.8.1" "typechain@^8.1.0"
[Registry] For more info go to https://hardhat.org/HH801 or run Hardhat with --show-stack-traces

while working in hardhat projects, i feel like i've seen this sorta issue before where hardhat keeps asking me to install/update things, even though they aren't needed.

maybe there's a hardhat.config.js file on your machine @bitsandtea that's causing issue—described here?

bitsandtea commented 1 year ago

here is my config file

import { HardhatUserConfig } from "hardhat/config";

import { config as dotenvConfig } from "dotenv";

import "@nomicfoundation/hardhat-toolbox";
import "@tableland/hardhat";
import "@nomicfoundation/hardhat-verify";

dotenvConfig();

const config: HardhatUserConfig = {
  solidity: "0.8.21",
  networks: {
    // Existing network configurations...
    sepolia: {
      url: `https://sepolia.infura.io/v3/${process.env.INFURA_KEY}` || "",
      chainId: 11155111, // Replace with your desired chain ID
      accounts: [process.env.TABLELAND_AUTH || ""], // Replace with your mnemonic phrase
    },
    mumbai: {
      url:
        `https://polygon-mumbai.infura.io/v3/${process.env.INFURA_KEY}` || "",
      chainId: 80001,
      accounts: [process.env.TABLELAND_AUTH || ""],
    },
  },
  etherscan: {
    // apiKey: process.env.ETHERSCAN_API,
    apiKey: process.env.POLYGONSCAN_API,
  },
};

export default config;
dtbuchholz commented 1 year ago

@bitsandtea i'm going to close this for now since i wasn't able to recreate the issue. but, lmk if it pops up again, and i can reopen.