Skip to content

"npx flowbite-react@latest init" generates a syntax error Sentry with Next.js #1623

@Fredneyy

Description

@Fredneyy
  • I have searched the Issues to see if this bug has already been reported
  • I have tested the latest version

Steps to reproduce

  1. Create a normal Next.js project without the Flowbite quick start command.
  2. Install and configure Sentry
  3. Run npx flowbite-react@latest init to install Flowbite React
  4. Check if you have a syntax error in next.config.mjs

Current behavior

The command wraps the withSentryConfig function around the withFlowbiteReact function in next.config.mjs.

The original function looks something like this:

export default withSentryConfig(nextConfig, {
    [...]
});

But when you run the command you end up with this:

export default withFlowbiteReact(withSentryConfig(nextConfig, {)
    [...]
});

If you look at the end of the first line you can see a misplaced parentheses that causes a syntax error.

Expected behavior

We would expect the command to wrap around the withSentryConfig function like this:

export default withFlowbiteReact(withSentryConfig(nextConfig, {
    [...]
}));

Metadata

Metadata

Assignees

Labels

🐛 bugSomething isn't working

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions