Skip to content

fix(frontend): remove invalid turbopack config key#3318

Merged
arkid15r merged 6 commits intoOWASP:mainfrom
mohith257:fix/invalid-turbo-config
Jan 18, 2026
Merged

fix(frontend): remove invalid turbopack config key#3318
arkid15r merged 6 commits intoOWASP:mainfrom
mohith257:fix/invalid-turbo-config

Conversation

@mohith257
Copy link
Contributor

@mohith257 mohith257 commented Jan 12, 2026

### Proposed change

Resolves #3275

** What was fixed**
This PR fixes warnings and instability in the frontend local development setup when using Turbopack with Docker.

Changes included:

    • Removed the unsupported experimental.turbo configuration from next.config.ts, which caused the warning:
  1. Unrecognized key(s) in object: 'turbo' at "experimental"
    • Enabled Turbopack using the supported CLI approach (next dev --turbo)
    • Updated the frontend Docker service to run the dev command directly (removed sh -c)
    • Added stdin_open: true and tty: true to keep the frontend container attached and prevent premature exit during development

Why this change is needed
Recent Next.js versions no longer support enabling Turbopack via configuration files.
Keeping the invalid key resulted in warnings and unstable behavior.

In Docker-based development, running the dev server without an attached TTY can cause the process to exit immediately.
Running the command directly and enabling STDIN/TTY ensures the frontend dev server remains active and behaves consistently.

Scope of change

  • Local development only
  • No production Dockerfile or runtime changes
  • No application logic changes
  • Improves developer experience and stability

Checklist

  • Required: I followed the contributing workflow
  • Required: I verified the frontend runs correctly in Docker after the change
  • Required: I ran make check-test locally (blocked by local environment limitations)
  • I used AI for communication related to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 12, 2026

Summary by CodeRabbit

  • Chores

    • Added an additional recognized term to the spell-check dictionary.
    • Reordered transpile package configuration for improved build handling.
  • Refactor

    • Simplified map component dependency management by delegating to the clustering package.
    • Enhanced local development command with a build-acceleration flag.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

Migrates Turbopack enablement from Next.js config to the dev CLI, adds React-Leaflet packages to Next.js transpilation, removes a side-effect import for marker clustering in ChapterMap, and adds "Turbopack" to the cspell custom dictionary.

Changes

Cohort / File(s) Summary
Next.js config & scripts
frontend/next.config.ts, frontend/package.json
Added transpilePackages: ['@react-leaflet/core','leaflet','react-leaflet','react-leaflet-cluster'] to Next.js config; updated dev script from next dev --port 3000 to next dev --port 3000 --turbo.
Component import cleanup
frontend/src/components/ChapterMap.tsx
Removed side-effect import of leaflet.markercluster; relies on react-leaflet-cluster to provide clustering dependency; added explanatory comment.
Spell-check dictionary
cspell/custom-dict.txt
Added token Turbopack to the custom dictionary.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

docker

Suggested reviewers

  • kasya
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(frontend): remove invalid turbopack config key' accurately describes the main change—removing the unsupported experimental.turbo configuration from next.config.ts.
Description check ✅ Passed The PR description is comprehensive and directly related to the changeset, explaining the fixes to remove invalid config, enable Turbopack via CLI, and update Docker configuration.
Linked Issues check ✅ Passed The PR successfully addresses all coding requirements from #3275: removes the unsupported experimental.turbo config from next.config.ts and enables Turbopack via the CLI in package.json dev script.
Out of Scope Changes check ✅ Passed The cspell dictionary update (adding 'Turbopack') is a minor supporting change that enables spell-checking for the term used throughout the changes, and does not introduce out-of-scope modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
.gitignore (1)

41-41: Consider scoping the ignore pattern to frontend/.

The pattern pnpm-workspace.yaml at root level will ignore this file anywhere in the repository. If the intent is only to ignore the auto-generated file in the frontend directory, use frontend/pnpm-workspace.yaml for precision.

Additionally, this entry appears out of the alphabetical grouping for frontend/ prefixed entries.

Suggested change
-pnpm-workspace.yaml
+frontend/pnpm-workspace.yaml

Place it after line 38 (frontend/pnpm-debug.log*) to maintain alphabetical order within the frontend/ section.

frontend/next.config.ts (1)

32-32: Minor: Inconsistent indentation.

Line 32 has an extra leading space before the comment. Same issue on line 54. This doesn't affect functionality but creates inconsistent formatting.

🔧 Suggested fix
-   // https://nextjs.org/docs/app/api-reference/config/next-config-js/poweredByHeader
+  // https://nextjs.org/docs/app/api-reference/config/next-config-js/poweredByHeader

And for line 54:

-         // https://docs.sentry.io/platforms/javascript/guides/nextjs/sourcemaps
+        // https://docs.sentry.io/platforms/javascript/guides/nextjs/sourcemaps
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 318d333 and 5e790d6.

📒 Files selected for processing (7)
  • .gitignore
  • cspell/custom-dict.txt
  • docker-compose/local/compose.yaml
  • frontend/next.config.ts
  • frontend/package.json
  • frontend/pnpm-workspace.yaml
  • frontend/src/components/ChapterMap.tsx
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-12-26T06:08:58.549Z
Learnt from: ahmedxgouda
Repo: OWASP/Nest PR: 3041
File: .github/workflows/run-ci-cd.yaml:233-243
Timestamp: 2025-12-26T06:08:58.549Z
Learning: Ensure Redis image versions stay in sync across all environments by updating every relevant YAML file together (docker-compose files and CI/CD workflow configurations). When upgrading Redis, bump the image version in all docker-compose files and in all CI workflow YAMLs in one coordinated change to maintain parity across production, staging, local, E2E, and CI tests.

Applied to files:

  • frontend/pnpm-workspace.yaml
  • docker-compose/local/compose.yaml
📚 Learning: 2025-10-26T12:50:50.512Z
Learnt from: ahmedxgouda
Repo: OWASP/Nest PR: 2429
File: backend/Makefile:30-32
Timestamp: 2025-10-26T12:50:50.512Z
Learning: The `exec-backend-e2e-command` and `exec-db-e2e-command` Makefile targets in the backend/Makefile are intended for local development and debugging only, not for CI/CD execution, so the `-it` flags are appropriate.

Applied to files:

  • docker-compose/local/compose.yaml
🔇 Additional comments (6)
frontend/pnpm-workspace.yaml (1)

1-7: Verify intent: this file is being gitignored.

This pnpm-workspace.yaml file configures ignoredBuiltDependencies to suppress build warnings for packages with native bindings. However, the .gitignore change in this PR adds pnpm-workspace.yaml to the ignore list.

If this file is auto-generated by pnpm and intentionally not committed, the configuration will need to be regenerated on each fresh clone. If the intent is to share this configuration across the team, consider removing it from .gitignore.

docker-compose/local/compose.yaml (1)

88-108: LGTM!

The simplified command and addition of stdin_open: true / tty: true are appropriate for local development. This aligns with the PR objective of improving frontend dev stability when using Turbopack in Docker, and the direct command format is cleaner than the previous sh -c wrapper.

cspell/custom-dict.txt (1)

32-32: LGTM!

The dictionary additions for "Turbopack" and "unrs" (line 140) are appropriate for this PR and maintain alphabetical ordering.

frontend/package.json (1)

7-7: Remove the --turbo flag — Turbopack is the default bundler in Next.js 16.

In Next.js 16.1.1, Turbopack is the default bundler and no longer requires the --turbo flag. The dev script should be:

    "dev": "next dev --port 3000",

If Webpack is needed instead, use --webpack to opt out. The --turbo flag is legacy syntax for Next.js 16+.

Likely an incorrect or invalid review comment.

frontend/next.config.ts (1)

8-9: Correct addition for ESM Leaflet package compatibility.

Adding transpilePackages for the Leaflet ecosystem packages ensures proper transpilation when using Turbopack and React 19. This aligns well with the ChapterMap.tsx changes and the PR's goal of enabling Turbopack via CLI.

frontend/src/components/ChapterMap.tsx (1)

17-18: LGTM - Dependency management correctly simplified.

The removal of the leaflet.markercluster side-effect import is correct since react-leaflet-cluster declares leaflet.markercluster as a regular dependency, making it automatically available without an explicit import. The CSS imports at lines 14-15 are properly retained, as they must be manually imported in modern setups for cluster styling.

coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 12, 2026
coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 18, 2026
@sonarqubecloud
Copy link

@arkid15r arkid15r added this pull request to the merge queue Jan 18, 2026
Merged via the queue into OWASP:main with commit a772cb4 Jan 18, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

invalid experimental.turbo config in Next.js 16 causes startup warning

2 participants

Comments