Polymarket / polymarket-subgraph

Polymarket's public subgraph manifest for indexing on-chain trade, volume, user, liquidity and market data.
GNU Lesser General Public License v3.0
33 stars 9 forks source link

Cannot perform codegen #26

Open paymog opened 2 years ago

paymog commented 2 years ago

Whenever I try to run some codegen I get the following error which is coming from gluegun:

 ❯❯❯ NETWORK_NAME=matic yarn prepare
yarn run v1.22.19
$ ts-node ./templatify.ts && yarn codegen
🎉 subgraph successfully generated for matic

$ graph codegen --debug --output-dir src/types/
node:internal/modules/cjs/loader:361
      throw err;
      ^

Error: Cannot find module '/home/ubuntu/code/polymarket-subgraph/node_modules/gluegun/build/index.js'. Please verify that the package.json has a valid "main" entry
    at tryPackage (node:internal/modules/cjs/loader:353:19)
    at Function.Module._findPath (node:internal/modules/cjs/loader:566:18)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/ubuntu/code/polymarket-subgraph/node_modules/@graphprotocol/graph-cli/src/cli.js:4:27)
    at Module._compile (node:internal/modules/cjs/loader:1099:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:975:32) {
  code: 'MODULE_NOT_FOUND',
  path: '/home/ubuntu/code/polymarket-subgraph/node_modules/gluegun/package.json',
  requestPath: 'gluegun'
}

Node.js v17.9.1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

It seems the graph-cli isn't working correctly and it's not clear how/why. Has anyone run into this before?

paymog commented 2 years ago

Looks to be related to https://github.com/graphprotocol/graph-cli/issues/814