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

Version Packages - V4 #2320

Merged
merged 1 commit into from
Dec 12, 2023
Merged

Version Packages - V4 #2320

merged 1 commit into from
Dec 12, 2023

Conversation

clerk-cookie
Copy link
Collaborator

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to release/v4, this PR will be updated.

Releases

@clerk/nextjs@4.27.7

Patch Changes

  • Use dynamic imports in <ClerkProvider /> which you import from @clerk/nextjs. (#2292) by @LekoArts

    Users on Next.js 12 and older can run into errors like these:

    error - ./node_modules/@clerk/nextjs/dist/esm/app-router/client/ClerkProvider.js:10:22
    Module not found: Can't resolve 'next/navigation'

    The aforementioned <ClerkProvider /> component contains code for both Next.js 12 (+ older) and Next.js 13 (+ newer). On older versions it can't find the imports only available in newer versions.

    If you're seeing these errors, you have to do two things:

    1. Update @clerk/nextjs to this version

    2. Update your next.config.js to ignore these imports:

      const webpack = require('webpack');
      
      /** @type {import('next').NextConfig} */
      const nextConfig = {
        reactStrictMode: true,
        webpack(config) {
          config.plugins.push(
            new webpack.IgnorePlugin({ resourceRegExp: /^next\/(navigation|headers|compat\/router)$/ }),
          );
          return config;
        },
      };
      
      module.exports = nextConfig;

      It is safe to ignore these modules as your Next.js 12 app won't hit these code paths.

@clerk-cookie clerk-cookie requested a review from a team as a code owner December 12, 2023 09:19
@LekoArts LekoArts added this pull request to the merge queue Dec 12, 2023
Merged via the queue into release/v4 with commit eb94116 Dec 12, 2023
7 checks passed
@LekoArts LekoArts deleted the changeset-release/release/v4 branch December 12, 2023 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants