Skip to content

'use client' error not compatible with vite #2034

@Gerome-Elassaad

Description

@Gerome-Elassaad

Describe the bug

When using components that include the 'use client' directive, Vite throws build errors indicating the directive is not supported. This prevents certain UI components from compiling or running as expected within the Bolt.diy environment.

Link to the Bolt URL that caused the error

http://localhost:5173

Steps to reproduce

Steps to reproduce

Open a Bolt project that uses Vite.

Add or import a React component containing 'use client' at the top.

Run the dev server or build the project.

Observe the build failing or showing compatibility errors.

Expected behavior

The components should build successfully or gracefully ignore 'use client' when running in a Vite environment.

Screen Recording / Screenshot

Image

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 91.1]

Provider Used

No response

Model Used

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions