Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
fix(next/image): update image stub for next v12.2
Browse files Browse the repository at this point in the history
NextJS no longer requires a bit of code added in to patch a bug that
existed in Next v12.1.5 and above. As of v12.2.0, this patch is no
longer needed, and furthermore causes a `TypeError` to be thrown when
attempting to ugprade to Next 12.

Fixes: #95
Related: #72
  • Loading branch information
tubbo committed Jun 28, 2022
1 parent 2dc55ea commit 375a4eb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/images/next-image-stub.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ if (semver.gt(process.env.__NEXT_VERSION!, '9.0.0')) {
})

// https://github.com/vercel/next.js/issues/36417#issuecomment-1117360509
if (semver.gte(process.env.__NEXT_VERSION!, '12.1.5')) {
if (
semver.gte(process.env.__NEXT_VERSION!, '12.1.5') &&
semver.lt(process.env.__NEXT_VERSION!, '12.2.0')
) {
Object.defineProperty(NextImage, '__esModule', {
configurable: true,
value: true
Expand Down

0 comments on commit 375a4eb

Please sign in to comment.