Skip to content

Commit e9b18d6

Browse files
next-codemod(upgrade): optional catch when missing dev script (vercel#71598)
### Why? During the next-codemod upgrade, when the `dev` script is missing, it throws while reading `.includes` the undefined value. Fixes vercel#71597 --------- Co-authored-by: Jiwon Choi <devjiwonchoi@gmail.com>
1 parent 9fac077 commit e9b18d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/next-codemod/bin/upgrade.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ function isUsingAppDir(projectPath: string): boolean {
412412
*/
413413
async function suggestTurbopack(packageJson: any): Promise<void> {
414414
const devScript: string = packageJson.scripts['dev']
415-
if (devScript.includes('--turbopack')) return
415+
if (devScript?.includes('--turbopack')) return
416416

417417
const responseTurbopack = await prompts(
418418
{

0 commit comments

Comments
 (0)