Unverified Commit e9b18d64 authored by Prakhar Shukla's avatar Prakhar Shukla Committed by GitHub

next-codemod(upgrade): optional catch when missing dev script (#71598)

### Why?

During the next-codemod upgrade, when the `dev` script is missing, it
throws while reading `.includes` the undefined value.

Fixes #71597

---------
Co-authored-by: 's avatarJiwon Choi <devjiwonchoi@gmail.com>
parent 9fac077c
......@@ -412,7 +412,7 @@ function isUsingAppDir(projectPath: string): boolean {
*/
async function suggestTurbopack(packageJson: any): Promise<void> {
const devScript: string = packageJson.scripts['dev']
if (devScript.includes('--turbopack')) return
if (devScript?.includes('--turbopack')) return
const responseTurbopack = await prompts(
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment