@clerk/nextjs
7.10.2 · 17 Nov 2026MIT4.1M / weekRepositoryHomepagenpmAtom feed
4.31.8 is the newest release of 4.x.
In short
1 fixed
Security
1 advisory affects 4.27.7; 4.29.3 fixes them
- Critical@clerk/nextjs auth() and getAuth() methods vulnerable to insecure direct object reference (IDOR) GHSA-q6w5-jg5q-47vg · 12 Jan 2024Fixed in 4.29.3
Release note
Patch Changes
Use dynamic imports in
<ClerkProvider />which you import from@clerk/nextjs.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:
Update
@clerk/nextjsto this versionUpdate your
next.config.jsto 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.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.