Skip to content

fix(ui/cli/setup-init): nextjs warning #1600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 24, 2025
Merged

Conversation

SutuSebastian
Copy link
Collaborator

@SutuSebastian SutuSebastian commented Jul 24, 2025

Changes

  • rename config -> CONFIG export in .flowbite-react/init.(jsx|tsx)

Summary by CodeRabbit

  • Refactor
    • Updated export naming in initialization files to address a Next.js warning. The exported identifier has been changed from config to CONFIG. This change does not affect app functionality or behavior.

@SutuSebastian SutuSebastian requested a review from rluders July 24, 2025 07:50
@SutuSebastian SutuSebastian self-assigned this Jul 24, 2025
@SutuSebastian SutuSebastian added the 🐛 bug Something isn't working label Jul 24, 2025
@SutuSebastian SutuSebastian linked an issue Jul 24, 2025 that may be closed by this pull request
2 tasks
Copy link

vercel bot commented Jul 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
flowbite-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 24, 2025 8:04am
flowbite-react-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 24, 2025 8:04am

Copy link

changeset-bot bot commented Jul 24, 2025

🦋 Changeset detected

Latest commit: 39b622f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
flowbite-react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

coderabbitai bot commented Jul 24, 2025

Walkthrough

The changes rename the exported constant from config to CONFIG in .flowbite-react/init.jsx and .flowbite-react/init.tsx files across multiple locations, including generated code within the CLI setup. All references to this export are updated accordingly to resolve a Next.js warning, with no other logic or functionality altered.

Changes

File(s) Change Summary
apps/storybook/.flowbite-react/init.tsx,
apps/web/.flowbite-react/init.tsx
Renamed exported constant config to CONFIG and updated all references within the file.
packages/ui/src/cli/commands/setup-init.ts Updated generated code string to export CONFIG instead of config in .flowbite-react/init.tsx.
.changeset/hungry-oranges-boil.md Added changeset describing the renaming from config to CONFIG for exported constants.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested reviewers

  • rluders

Poem

A rabbit saw CONFIG leap and bound,
No more warnings to be found!
From config small to CONFIG tall,
The code now stands proud and all.
With every hop, the bugs take flight—
Hooray for naming done just right! 🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

apps/web/.flowbite-react/init.tsx

Oops! Something went wrong! :(

ESLint: 8.57.0

ESLint couldn't find the config "next/core-web-vitals" to extend from. Please check that the name of the config is correct.

The config "next/core-web-vitals" was referenced from the config file in "/apps/web/.eslintrc.cjs".

If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.

apps/storybook/.flowbite-react/init.tsx

Oops! Something went wrong! :(

ESLint: 8.57.0

ESLint couldn't find the plugin "eslint-plugin-react".

(The package "eslint-plugin-react" was not found when loaded as a Node module from the directory "/apps/storybook".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install eslint-plugin-react@latest --save-dev

The plugin "eslint-plugin-react" was referenced from the config file in "apps/storybook/.eslintrc.cjs".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

packages/ui/src/cli/commands/setup-init.ts

Oops! Something went wrong! :(

ESLint: 8.57.0

ESLint couldn't find the plugin "eslint-plugin-react".

(The package "eslint-plugin-react" was not found when loaded as a Node module from the directory "/packages/ui".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install eslint-plugin-react@latest --save-dev

The plugin "eslint-plugin-react" was referenced from the config file in "packages/ui/.eslintrc.cjs".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d1ee1eb and 39b622f.

📒 Files selected for processing (4)
  • .changeset/hungry-oranges-boil.md (1 hunks)
  • apps/storybook/.flowbite-react/init.tsx (1 hunks)
  • apps/web/.flowbite-react/init.tsx (1 hunks)
  • packages/ui/src/cli/commands/setup-init.ts (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
apps/web/.flowbite-react/init.tsx (1)
apps/storybook/.flowbite-react/init.tsx (2)
  • CONFIG (12-16)
  • ThemeInit (18-20)
apps/storybook/.flowbite-react/init.tsx (1)
apps/web/.flowbite-react/init.tsx (2)
  • CONFIG (12-16)
  • ThemeInit (18-20)
🔇 Additional comments (8)
apps/storybook/.flowbite-react/init.tsx (2)

12-16: LGTM: Consistent constant renaming

The export constant has been correctly renamed from config to CONFIG, following proper naming conventions for constants.


19-19: LGTM: Spread operator updated correctly

The ThemeInit function correctly references the renamed CONFIG constant in the spread operator.

apps/web/.flowbite-react/init.tsx (2)

12-16: LGTM: Consistent with other init files

The constant renaming matches the pattern applied across all generated init files.


19-19: LGTM: Function reference updated correctly

The spread operator correctly uses the renamed CONFIG constant.

.changeset/hungry-oranges-boil.md (1)

1-10: LGTM: Well-documented changeset

The changeset properly documents this as a patch fix with clear description of the changes made to address the Next.js warning.

packages/ui/src/cli/commands/setup-init.ts (3)

27-31: LGTM: Template updated to use uppercase constant

The generated template correctly exports CONFIG instead of config, which will ensure all generated init files use the new naming convention.


34-34: LGTM: Template function references updated

The ThemeInit function template correctly spreads the renamed CONFIG constant.


27-34: Existing init templates now use CONFIG
I searched all init.tsx/init.jsx files and found no remaining export const config or StoreInit {…config} patterns. Existing projects will generate init files with the new CONFIG constant.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/1598/nextjs-warning

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@SutuSebastian SutuSebastian merged commit 12d3290 into main Jul 24, 2025
8 checks passed
@SutuSebastian SutuSebastian deleted the fix/1598/nextjs-warning branch July 24, 2025 08:23
@github-actions github-actions bot mentioned this pull request Jul 24, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Page config in .flowbite-react/init.tsx is deprecated - NextJS warning
1 participant