Skip to content

Commit

Permalink
Merge pull request #20098 from storybookjs/fix/next-12-future-image
Browse files Browse the repository at this point in the history
Next.js: only set next/future/image mocks from version 12.2
  • Loading branch information
valentinpalkovic authored Dec 6, 2022
2 parents ad94805 + da5022f commit 6ae449f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion code/frameworks/nextjs/src/images/next-image-stub.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ if (semver.satisfies(process.env.__NEXT_VERSION!, '^13.0.0')) {
});
}

if (semver.satisfies(process.env.__NEXT_VERSION!, '^12.0.0')) {
if (semver.satisfies(process.env.__NEXT_VERSION!, '^12.2.0')) {
const NextFutureImage = require('next/future/image') as typeof _NextImage;
const OriginalNextFutureImage = NextFutureImage.default;

Expand Down
2 changes: 1 addition & 1 deletion code/lib/cli/src/repro-templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const allTemplates: Record<string, Template> = {
'nextjs/12-js': {
name: 'Next.js v12 (JavaScript)',
script:
'yarn create next-app {{beforeDir}} -e https://github.com/vercel/next.js/tree/next-12-3-2/examples/hello-world && cd {{beforeDir}} && npm pkg set "dependencies.next"="^12" && yarn && git add . && git commit --amend --no-edit && cd ..',
'yarn create next-app {{beforeDir}} -e https://github.com/vercel/next.js/tree/next-12-3-2/examples/hello-world && cd {{beforeDir}} && npm pkg set "dependencies.next"="^12.2.0" && yarn && git add . && git commit --amend --no-edit && cd ..',
expected: {
framework: '@storybook/nextjs',
renderer: '@storybook/react',
Expand Down

0 comments on commit 6ae449f

Please sign in to comment.