Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions code/lib/create-storybook/src/scaffold-new-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ const SUPPORTED_PROJECTS: Record<string, SupportedProject> = {
language: 'TS',
},
createScript: {
npm: 'npm create next-app . -- --turbopack --typescript --use-npm --eslint --tailwind --no-app --import-alias="@/*" --src-dir',
npm: 'npm create next-app . -- --turbopack --typescript --use-npm --eslint --tailwind --no-app --import-alias="@/*" --src-dir --no-react-compiler',
// yarn doesn't support version ranges, so we have to use npx
yarn: 'npx create-next-app . --turbopack --typescript --use-yarn --eslint --tailwind --no-app --import-alias="@/*" --src-dir',
pnpm: 'pnpm create next-app . --turbopack --typescript --use-pnpm --eslint --tailwind --no-app --import-alias="@/*" --src-dir',
yarn: 'npx create-next-app . --turbopack --typescript --use-yarn --eslint --tailwind --no-app --import-alias="@/*" --src-dir --no-react-compiler',
pnpm: 'pnpm create next-app . --turbopack --typescript --use-pnpm --eslint --tailwind --no-app --import-alias="@/*" --src-dir --no-react-compiler',
Comment on lines +49 to +52

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify the --no-react-compiler flag and provide context for the change.

The addition of --no-react-compiler to all Next.js project creation commands needs verification:

  1. Flag validity: Confirm that --no-react-compiler is a supported flag in create-next-app. The React Compiler feature may have specific version requirements or may not be available in all Next.js versions.

  2. Missing context: The PR description is empty, providing no explanation for why this change is necessary. The PR title mentions "Fix Nextjs project creation in empty directories" and the branch name suggests it addresses a "hanging" issue, but there's no description of:

    • What specific problem occurred with the React compiler during project creation
    • Why disabling the React compiler resolves the issue
    • Whether this was reproducible and how
  3. Behavior change: This modifies the default behavior of Next.js scaffolding. Users will now have projects created without the React compiler by default. Consider documenting this change if it's intentional.

  4. Testing: No tests were added or updated for this bug fix. Consider adding:

    • Integration tests to verify Next.js projects are created successfully with this flag
    • Tests to verify the flag is present in all package manager variants

Run the following script to check the latest create-next-app documentation and verify flag support:

Additionally, verify the flag is correctly formatted by checking if it's being passed to create-next-app:


🏁 Script executed:

#!/bin/bash
# Description: Verify Next.js project creation commands and check for similar flag patterns

# Check if there are any other occurrences or references to react-compiler in the codebase
rg -n "react-compiler" --type ts --type js -C 3

# Look for any related test files that should be updated
fd -e ts -e js "scaffold.*test" --exec echo "Test file: {}"

Length of output: 1178


🌐 Web query:

Does create-next-app support the --no-react-compiler flag?

💡 Result:

Short answer: No — create-next-app does not provide a dedicated --no-react-compiler flag. The create-next-app CLI supports generic --no-* negation for listed defaults (e.g., --no-eslint, --no-ts) but there’s no --no-react-compiler option in the CLI reference. To opt out of the React Compiler, pick a template without it or disable the feature in your app’s next.config.js. [1][2][3]

Sources:

  • create-next-app CLI reference (shows available flags and --no-* pattern). [1]
  • Next.js docs for the React Compiler (how to enable/configure it in next.config.js). [2]
  • React team announcement noting create-next-app templates may include the compiler (how new apps can opt into templates). [3]

Remove the unsupported --no-react-compiler flag from all Next.js create commands (lines 49, 51, 52).

The --no-react-compiler flag is not a supported option in create-next-app. Create-next-app only supports generic --no-* negation for listed defaults (e.g., --no-eslint, --no-ts), and there is no --no-react-compiler option in the CLI reference. To opt out of the React Compiler, you should pick a template without it or disable the feature in your app's next.config.js.

The invalid flag will be passed to the CLI but ignored or cause an error, breaking the scaffolding process. Remove --no-react-compiler from:

  • Line 49 (npm command)
  • Line 51 (yarn command)
  • Line 52 (pnpm command)
🤖 Prompt for AI Agents
In code/lib/create-storybook/src/scaffold-new-project.ts around lines 49 to 52,
the create-next-app commands include the unsupported --no-react-compiler flag
which can break or be ignored by the CLI; remove --no-react-compiler from the
npm, yarn, and pnpm command strings and keep the rest of flags intact (if opting
out of React Compiler is required, handle it via selecting a different template
or configuring next.config.js instead of passing this CLI flag).

},
},
'vue-vite-ts': {
Expand Down
Loading