graphile / crystal-pre-merge

Repository moved
https://github.com/graphile/crystal
39 stars 7 forks source link

"Attempted to add a second resource" error stringifies [object Object] #447

Closed dmfay closed 1 year ago

dmfay commented 1 year ago

I got this on startup:

/app/node_modules/@dataplan/pg/dist/datasource.js:663
  throw new Error(`Attempted to add a second resource named '${resource.name}' (existing: ${existing}, new: ${resource})`);
        ^
Error: Attempted to add a second resource named 'team' (existing: [object Object], new: [object Object])
  at Object.addResource (/app/node_modules/@dataplan/pg/dist/datasource.js:663:27)
  at /app/node_modules/graphile-build-pg/dist/plugins/PgProceduresPlugin.js:346:41
  at processTicksAndRejections (node:internal/process/task_queues:96:5)

I'm not sure what's wrong yet so I don't have other context, but let me know if there's any debugging I can do on this side!

benjie commented 1 year ago

Error improved to something like:

Error: Attempted to add a second resource named 'foo' (first represented function accepting 0 parameters and returning SQL type '"bool"', second represents table/view/etc called '"public"."foo"')