allen
allen2y ago

Also having an issue introducing ` clerk

Also having an issue introducing @clerk/backend lib to my app as it depends on node-fetch-native.
Error: Unable to push deployment config to https://acoustic-pelican-966.convex.cloud
✖ Waiting for all table indexes to be backfilled...
400 Bad Request: InvalidModules: Loading the pushed modules encountered the following
error:
Dynamic require of "node:fs" is not supported.
at ../../node_modules/@clerk/backend/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs (../../../../../node_modules/@clerk/backend/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs:3:0)
at __require2 (convex:/user/actions/_deps/Q47GIZLF.js:16:50)
at <anonymous> (../../../../../node_modules/@clerk/backend/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs:444:21)
Error: Unable to push deployment config to https://acoustic-pelican-966.convex.cloud
✖ Waiting for all table indexes to be backfilled...
400 Bad Request: InvalidModules: Loading the pushed modules encountered the following
error:
Dynamic require of "node:fs" is not supported.
at ../../node_modules/@clerk/backend/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs (../../../../../node_modules/@clerk/backend/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs:3:0)
at __require2 (convex:/user/actions/_deps/Q47GIZLF.js:16:50)
at <anonymous> (../../../../../node_modules/@clerk/backend/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs:444:21)
16 Replies
allen
allenOP2y ago
I suppose I can make direct rest calls, but it would be great to have support for this lib @ian since Convex has more formal support for Clerk now.
jamwt
jamwt2y ago
@presley has been doing a lot of work on our bundler and node support lately, pinging him
ian
ian2y ago
I’m curious what you are using the backend package for. What calls do you want to make to Clerk? And are you using this module from an action or from a query / mutation?
allen
allenOP2y ago
During a social signup routine, I need to injest profile fields from the newly created user that Clerk syncs to their user record from the federated provider. Its from an action that gets scheduled by my createUser mutation
ian
ian2y ago
Gotcha, fields that aren’t available on the auth.getUserIdentity that are Clerk-specific?
allen
allenOP2y ago
uhh good question
ian
ian2y ago
You can customize which fields get passed into that object in the “claims” config
allen
allenOP2y ago
I'll look into that, but regardless, I imagine there will be other backend integrations I'd want with clerk in the future.
ian
ian2y ago
Just fyi, only fields that are part of the OpenID spec will make it through to our backend. But I get it- Clerk will likely provide APIs beyond what we could provide through the auth bit. I’ll let Presley talk to the bundling / dependency issue
allen
allenOP2y ago
first/last/email/avatar is what I'm interested in
ian
ian2y ago
Oh all those are already available. If avatar == profile picture I think we list the claims to make in our Clerk docs
allen
allenOP2y ago
Anything beyond that I would want to fetch the oauth access token for the social provider and make calls to that API to enrich further. (tangible example of what I'd need backend access to clerk for) https://clerk.com/docs/reference/backend-api/tag/Users#operation/GetOAuthAccessToken
presley
presley2y ago
Looking at the issue with the import
allen
allenOP2y ago
Thanks. It looks like it worked with the auth.getUserIdentity, @ian, however, Clerk stores a very low res version of the profile picture, so I'll want to fetch the original image from the social provider.
presley
presley2y ago
You should be able to use @clerk/backend now if you still need it. Sorry about the trouble. Let us know if you see any additional issues.
allen
allenOP2y ago
Thanks for the quick turn around @presley !

Did you find this page helpful?