quantified-uncertainty / metaforecast

Fetch forecasts from prediction markets/forecasting platforms to make them searchable. Integrate these forecasts into other services.
https://metaforecast.org/
MIT License
56 stars 5 forks source link

fix platform fetching errors #75

Closed NunoSempere closed 2 years ago

NunoSempere commented 2 years ago

I'm getting a

TypeError: Cannot read properties of undefined (reading 'findMany')
    at /home/loki/Documents/core/software/fresh/js/metaforecast/metaforecast-monorepo/src/backend/platforms/index.ts:108:46
    at Generator.next (<anonymous>)
    at fulfilled (/home/loki/Documents/core/software/fresh/js/metaforecast/metaforecast-monorepo/src/backend/platforms/index.ts:5:58)
    at runMicrotasks (<anonymous>)

When changing a "question" to "questions" in ...platforms/index.js:133 & ss, I get different errors

berekuk commented 2 years ago

You probably haven't ran prisma generate. I should document it...

berekuk commented 2 years ago

I added a mention in README, and then removed it because turns out that it's invoked automatically on first npm install, so it's not necessary to mention in the README :)

I'll think about how to incorporate it to some other docs (docs/prisma.md?), but I don't want to simply repeat prisma docs.

So, @prisma/client is generated by prisma generate, which generates the code which is stored in node_modules (node_modules/.prisma/client). Full docs: https://www.prisma.io/docs/concepts/components/prisma-client/working-with-prismaclient/generating-prisma-client. You should also run prisma generate on any schema changes.