Skip to content

Commit 7b1c9f1

Browse files
fix(nextjs): Catch exceptions when syncing plug-in's version (#3444)
Fixes #3441 Vercel's file system is read-only, so it throws an exception when trying to rewrite the plugin's version. This happens in runtime in every request in serverless environments. Users are supposed to build the app before deploying it to Vercel (where the file system isn't read-only), since the plugin version must still be sync-ed.
1 parent 665b3a1 commit 7b1c9f1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/nextjs/src/utils/config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,9 @@ export function withSentryConfig(
104104
};
105105
}
106106

107-
syncPluginVersionWithNextVersion();
107+
try {
108+
syncPluginVersionWithNextVersion();
109+
} catch (error) {
110+
logger.warn(`[next-plugin-sentry] Cannot sync plug-in and next versions. Plug-in may not work, versions must match.`);
111+
logger.warn('[next-plugin-sentry] A local project build should sync the versions, before deploying it.');
112+
}

0 commit comments

Comments
 (0)