Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions .changeset/selfish-books-matter.md

This file was deleted.

39 changes: 39 additions & 0 deletions packages/nextjs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,44 @@
# Change Log

## 4.27.7

### Patch Changes

- Use dynamic imports in `<ClerkProvider />` which you import from `@clerk/nextjs`. ([#2292](https://github.com/clerk/javascript/pull/2292)) by [@LekoArts](https://github.com/LekoArts)

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

```shell
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
1. Update your `next.config.js` to ignore these imports:

```js
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.

## 4.27.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@clerk/nextjs",
"version": "4.27.6",
"version": "4.27.7",
"description": "Clerk SDK for NextJS",
"keywords": [
"clerk",
Expand Down