Hmm that’s weird. I just tried to reproduce it but couldn’t.
I have a theory though. It’s kind of a long story but essentially I had unfortunate timing when I originally published the package – it happened to be during the Atmosphere outage on Oct 31. The Meteor team helped me resolve the issue and I republished the package which seemed to work correctly. Since you’re seeing this issue, I wonder if there is still something wonky.
13:10:32 in FamZ24 on main [?] via ⬢ v16.16.0 using ☁️ default/ki-bot-395608 via 🅒 base took 2s
➜ meteor add jam:method
/Users/jan-michaelpilgenroeder/.meteor/packages/meteor-tool/.2.14.0.9et9d9.ajq4o++os.osx.arm64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.arm64/dev_bundle/lib/node_modules/meteor-promise/promise_server.js:218
throw error;
^
Error: Found multiple packages matching name: jam:method
at RemoteCatalog.getPackage (/tools/packaging/catalog/catalog-remote.js:602:13)
at LayeredCatalog._returnFirst (/tools/packaging/catalog/catalog.js:190:32)
at LayeredCatalog.getPackage (/tools/packaging/catalog/catalog.js:194:17)
at /tools/cli/commands-packages.js:2207:59
at Object.enterJob (/tools/utils/buildmessage.js:388:12)
at /tools/cli/commands-packages.js:2197:20
at Function.each (/Users/jan-michaelpilgenroeder/.meteor/packages/meteor-tool/.2.14.0.9et9d9.ajq4o++os.osx.arm64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.arm64/dev_bundle/lib/node_modules/underscore/underscore-node-f-pre.js:1316:7)
at /tools/cli/commands-packages.js:2196:7
at Object.capture (/tools/utils/buildmessage.js:283:5)
at Command.func (/tools/cli/commands-packages.js:2195:31)
at /tools/cli/main.js:1534:15
I just published an update that allows for validating without executing the method.
Here’s a quick look:
// define a method
export const create = createMethod({
name: 'todos.create',
schema: Todos.schema,
async run({ text }) {
// ... //
}
});
// validate against the schema without executing the method
create.validate({...})
// validate against only the relevant part of the schema based on the data passed in without executing the method
create.validate.only({...})
I’ll demonstrate soon how I plan to use .validate.only in particular for form UX.
I’ve just published an update to make jam:method compatible with Meteor 3.0-rc.4, the latest release candidate.
If you like writing your methods isomorphically and are looking for a way to make your app feel instant for users, this section of the readme might be of interest to you.