javascript
javascript copied to clipboard
> 4.2.1 - Redwood JS API Server throws error
- [x] Review the documentation: https://docs.clerk.dev/
- [x] Search for existing issues: https://github.com/clerkinc/javascript/issues
- [x] Go through package changelog files.
- [ ] Provide the Frontend API key from your application dashboard.
Package + Version
- [ ]
@clerk/clerk-js - [ ]
@clerk/clerk-react - [ ]
@clerk/nextjs - [ ]
@clerk/remix - [ ]
@clerk/types - [ ]
@clerk/themes - [ ]
@clerk/clerk-expo - [ ]
@clerk/backend-core - [x]
@clerk/clerk-sdk-node - [ ]
@clerk/edge - [ ] other:
Version:
> 4.2.1
Browser/OS
API Backend only
Description
When using the latest Redwood JS, getting the following error:
api | 11:03:09 🚨 graphql-server Error building context. Error: Exception in getAuthenticationContext: Cannot find module './dist/instance'
api | Require stack:
api | - /Users/ariperez/github/beacon-redwood/node_modules/@clerk/clerk-sdk-node/instance.js
api | - /Users/ariperez/github/beacon-redwood/node_modules/@redwoodjs/api/dist/auth/decoders/clerk.js
api | - /Users/ariperez/github/beacon-redwood/node_modules/@redwoodjs/api/dist/auth/decoders/index.js
api | - /Users/ariperez/github/beacon-redwood/node_modules/@redwoodjs/api/dist/auth/index.js
api | - /Users/ariperez/github/beacon-redwood/node_modules/@redwoodjs/api/dist/index.js
api | - /Users/ariperez/github/beacon-redwood/node_modules/@redwoodjs/graphql-server/dist/functions/graphql.js
api | - /Users/ariperez/github/beacon-redwood/node_modules/@redwoodjs/graphql-server/dist/index.js
api | - /Users/ariperez/github/beacon-redwood/api/dist/functions/graphql.js
api | - /Users/ariperez/github/beacon-redwood/node_modules/@redwoodjs/api-server/dist/plugins/lambdaLoader.js
api | - /Users/ariperez/github/beacon-redwood/node_modules/@redwoodjs/api-server/dist/plugins/withFunctions.js
api | - /Users/ariperez/github/beacon-redwood/node_modules/@redwoodjs/api-server/dist/cliHandlers.js
api | - /Users/ariperez/github/beacon-redwood/node_modules/@redwoodjs/api-server/dist/index.js
Thanks for reporting. This is a known issue that we will fix ASAP.
Meanwhile, you can try the following:
const Clerk = require('@clerk/clerk-sdk-node/cjs/instance').default
Or
const { createClerkClient } = require("@clerk/clerk-sdk-node");
const clerk = createClerkClient({
apiKey: process.env.CLERK_API_KEY,
});
const users = await clerk.users.getUserList();
...
Thanks for reporting. This is a known issue that we will fix ASAP.
Meanwhile, you can try the following:
const Clerk = require('@clerk/clerk-sdk-node/cjs/instance').defaultOr
const { createClerkClient } = require("@clerk/clerk-sdk-node"); const clerk = createClerkClient({ apiKey: process.env.CLERK_API_KEY, }); const users = await clerk.users.getUserList(); ...
Thanks!
This should be fixed by https://github.com/redwoodjs/redwood/pull/6685