cdaringe/postgraphile-upsert

No plugin found matching spec

AdrienPensart opened this issue · 5 comments

Hello,

I am still a beginner with postgraphile and plugins, I use only the CLI, not the express.js or javascript, I have this error :

yarn add postgraphile-upsert-plugin
DEBUG=postgraphile:postgres:notice postgraphile [other options] --append-plugins postgraphile-plugin-connection-filter,@graphile-contrib/pg-simplify-inflector,postgraphile-upsert-plugin
/home/crunch/.nvm/versions/node/v16.8.0/lib/node_modules/postgraphile/build/postgraphile/cli.js:304
            throw new Error(`No plugin found matching spec '${name}' - expected function, found '${typeof plugin}'`);
            ^

Error: No plugin found matching spec 'postgraphile-upsert-plugin' - expected function, found 'object'
    at /home/crunch/.nvm/versions/node/v16.8.0/lib/node_modules/postgraphile/build/postgraphile/cli.js:304:19
    at Array.map (<anonymous>)
    at loadPlugins (/home/crunch/.nvm/versions/node/v16.8.0/lib/node_modules/postgraphile/build/postgraphile/cli.js:274:18)
    at Object.<anonymous> (/home/crunch/.nvm/versions/node/v16.8.0/lib/node_modules/postgraphile/build/postgraphile/cli.js:342:23)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153: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:94:18)

Hmmm we don’t use default export or module.exports = plugin, but we sure could. Would be a single LOC change. Want to send a patch?

actually, ill patch it now

fixed in 2.0.0

in 2.0.1, moved back to the esm style export. docs have been updated on how to use the plugin!

Thank you!