Skip to content

fix(nextjs): Adjust shared imports to remove edge runtime warnings - #1924

Merged
LekoArts merged 3 commits into
mainfrom
brk.fix/next-address-runtime-import-warnings
Oct 20, 2023
Merged

fix(nextjs): Adjust shared imports to remove edge runtime warnings#1924
LekoArts merged 3 commits into
mainfrom
brk.fix/next-address-runtime-import-warnings

Conversation

@brkalow

@brkalow brkalow commented Oct 20, 2023

Copy link
Copy Markdown
Member

Description

Updates our @clerk/shared imports to remove some warnings about importing unsupported methods in certain runtimes. As part of this, I've also moved some utils out of shared/utils into their own dedicated files so that they can be imported on their own.

  • isDevelopmentFromApiKey has been moved to shared/keys
  • isProductionFromApiKey has been moved to shared/keys
  • Moved callWithRetry into its top-level file

Example:

/node_modules/@clerk/shared/dist/esm/utils/localStorageBroadcastChannel.js
--
A Node.js API is used (MessageEvent at line: 23) which is not supported in the Edge Runtime.
Learn more: https://nextjs.org/docs/api-reference/edge-runtime
 
Import trace for requested module:
./node_modules/@clerk/shared/dist/esm/utils/localStorageBroadcastChannel.js
./node_modules/@clerk/shared/dist/esm/utils/index.js
./node_modules/@clerk/shared/dist/esm/index.js
./node_modules/@clerk/clerk-react/dist/esm/errors.js
./node_modules/@clerk/clerk-react/dist/esm/index.js
./node_modules/@clerk/nextjs/dist/esm/client-boundary/controlComponents.js
./node_modules/@clerk/nextjs/dist/esm/index.js

Note: This does not address the warnings that arise from import { authMiddleware } from '@clerk/nextjs'. This is a separate case that we'll need to handle differently.

related to JS-599

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Packages affected

  • @clerk/clerk-js
  • @clerk/clerk-react
  • @clerk/nextjs
  • @clerk/remix
  • @clerk/types
  • @clerk/themes
  • @clerk/localizations
  • @clerk/clerk-expo
  • @clerk/backend
  • @clerk/clerk-sdk-node
  • @clerk/shared
  • @clerk/fastify
  • @clerk/chrome-extension
  • gatsby-plugin-clerk
  • build/tooling/chore

@brkalow
brkalow requested a review from a team as a code owner October 20, 2023 03:09
@changeset-bot

changeset-bot Bot commented Oct 20, 2023

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e8231f0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
@clerk/backend Patch
@clerk/nextjs Patch
@clerk/shared Patch
@clerk/clerk-react Patch
@clerk/fastify Patch
gatsby-plugin-clerk Patch
@clerk/remix Patch
@clerk/clerk-sdk-node Patch
@clerk/clerk-js Patch
@clerk/clerk-expo Patch
@clerk/chrome-extension Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@brkalow brkalow changed the title fix(nextjs): Adjust shared imports to remove runtime warnings on import fix(nextjs): Adjust shared imports to remove edge runtime warnings Oct 20, 2023
@LekoArts
LekoArts added this pull request to the merge queue Oct 20, 2023
Merged via the queue into main with commit 92727ee Oct 20, 2023
@LekoArts
LekoArts deleted the brk.fix/next-address-runtime-import-warnings branch October 20, 2023 06:55
@clerk-cookie clerk-cookie mentioned this pull request Oct 20, 2023
@clerk-cookie

Copy link
Copy Markdown
Collaborator

This PR has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@clerk clerk locked as resolved and limited conversation to collaborators Oct 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants