Skip to content

Version Packages - V4 - #2320

Merged
LekoArts merged 1 commit into
release/v4from
changeset-release/release/v4
Dec 12, 2023
Merged

Version Packages - V4#2320
LekoArts merged 1 commit into
release/v4from
changeset-release/release/v4

Conversation

@clerk-cookie

Copy link
Copy Markdown
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
@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