From 33f7e63b200ed5f4d37f035afc9e20894eb6fae9 Mon Sep 17 00:00:00 2001 From: Jack Hsu Date: Tue, 18 Apr 2023 09:02:39 -0400 Subject: [PATCH] feat(nextjs): add migration for Next.js 13.3.0 --- packages/next/migrations.json | 9 +++++++++ packages/react/plugins/storybook/index.ts | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/packages/next/migrations.json b/packages/next/migrations.json index 80962be71bf303..daad88978238ba 100644 --- a/packages/next/migrations.json +++ b/packages/next/migrations.json @@ -307,6 +307,15 @@ "alwaysAddToPackageJson": false } } + }, + "16.0.0": { + "version": "16.0.0-beta.0", + "packages": { + "next": { + "version": "13.3.0", + "alwaysAddToPackageJson": false + } + } } } } diff --git a/packages/react/plugins/storybook/index.ts b/packages/react/plugins/storybook/index.ts index dcdb767991ab6d..54c23f4e622762 100644 --- a/packages/react/plugins/storybook/index.ts +++ b/packages/react/plugins/storybook/index.ts @@ -116,6 +116,14 @@ export const webpack = async ( }, resolve: { ...storybookWebpackConfig.resolve, + fallback: { + ...storybookWebpackConfig.resolve?.fallback, + // Next.js and other React frameworks may have server-code that uses these modules. + // They are not meant for client-side components so skip the fallbacks. + assert: false, + path: false, + util: false, + }, plugins: mergePlugins( ...((storybookWebpackConfig.resolve.plugins ?? []) as ResolvePluginInstance[]),