SVELTE: createMethod should never be called on the client. Ensure you have @zodern/babel-plugin-meteor-reify configured
tosinek opened this issue · 5 comments
I think I follow the steps as per readme, but it doesn't seem to be working. Maybe the babel plugin doesn't work here?
Also the error message references meteor-reify, which is nowhere to be found, so I guess it is just a typo in the client-main.ts
file.
An example repo https://github.com/tosinek/zodern-relay-error
It is just the meteor create --svelte
with zodern-relay
added.
Same issue for react project. I think zodern:relay is not maintained anymore unfortunately :(
When calling the method in the reproduction, I am seeing this error, which is caused by the method not having a schema.
I20231018-11:38:23.991(-5)? Exception while invoking method 'add' TypeError: Cannot read property 'parse' of undefined
I20231018-11:38:24.038(-5)? at MethodInvocation.add (packages/zodern:relay/server-main.ts:78:47)
I20231018-11:38:24.038(-5)? at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1902:12)
I20231018-11:38:24.038(-5)? at getCurrentMethodInvocationResult (packages/ddp-server/livedata_server.js:772:38)
I20231018-11:38:24.038(-5)? at packages/meteor.js:365:18
I20231018-11:38:24.038(-5)? at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1389:31)
I20231018-11:38:24.038(-5)? at packages/ddp-server/livedata_server.js:791:46
I20231018-11:38:24.038(-5)? at new Promise (<anonymous>)
I20231018-11:38:24.038(-5)? at Session.method (packages/ddp-server/livedata_server.js:739:23)
I20231018-11:38:24.038(-5)? at packages/ddp-server/livedata_server.js:603:43
I'm not seeing the error createMethod should never be called on the client. Ensure you have @zodern/babel-plugin-meteor-reify configured
. Are you using Windows?
Yes, Windows. I've just tried to run it in WSL and it works fine (after adding a schema to the method).
I released an update to the babel plugin that fixes running on Windows.
You are the best, thank you zodern! (I am loggin another bug though :))