Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

> 4.2.1 - Redwood JS API Server throws error #444

Closed
4 of 15 tasks
ariperez opened this issue Oct 14, 2022 · 3 comments
Closed
4 of 15 tasks

> 4.2.1 - Redwood JS API Server throws error #444

ariperez opened this issue Oct 14, 2022 · 3 comments

Comments

@ariperez
Copy link

Package + Version

  • @clerk/clerk-js
  • @clerk/clerk-react
  • @clerk/nextjs
  • @clerk/remix
  • @clerk/types
  • @clerk/themes
  • @clerk/clerk-expo
  • @clerk/backend-core
  • @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
@SokratisVidros
Copy link
Contributor

SokratisVidros commented Oct 14, 2022

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();

...

@ariperez
Copy link
Author

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!

@SokratisVidros
Copy link
Contributor

This should be fixed by redwoodjs/redwood#6685

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants