Skip to content

[BUG]: Error: "Unexpected token (1:0)" when trying to install @react-bits/Lanyard-JS-CSS via shadcn CLI #1049

Description

@eyob231

Describe the issue

I'm encountering a persistent error when attempting to add the @react-bits/Lanyard-JS-CSS component using the shadcn CLI. The installation fails with an "Unexpected token (1:0)" error across multiple versions of the CLI.

Reproduction Link

No response

Steps to reproduce

Run the following command in a Next.js/React project:

bash
npx shadcn@4.18.0 add @react-bits/Lanyard-JS-CSS
Observe the error:

text
✔ Checking registry.
⠼ Updating files.

Something went wrong. Please check the error below for more details.
If the problem persists, please open an issue on GitHub.

Unexpected token (1:0)
Tried downgrading to previous versions as suggested:

bash
npx shadcn@4.17.0 add @react-bits/Lanyard-JS-CSS
npx shadcn@4.16.0 add @react-bits/Lanyard-JS-CSS
All attempts resulted in the same error.

Expected Behavior
The component should install successfully via the shadcn CLI.

Actual Behavior
Installation fails with "Unexpected token (1:0)" error. The process gets stuck at "Updating files" before failing.

Environment
OS: Windows (PowerShell)

Node Version: [Add your Node version]

Package Manager: npm

Project: Next.js/React portfolio project

shadcn CLI Versions Attempted: 4.18.0, 4.17.0, 4.16.0

Additional Context
Running in PowerShell (PS C:\Users\eyob\portfolio>)

The CLI successfully checks the registry but fails during file updates

The error message suggests it might be a parsing issue with the component files

Possible Cause
The "Unexpected token (1:0)" error typically indicates a syntax error at the first character of a file. This could be due to:

Invalid JSON/JSX in the component source

Malformed registry entry

Encoding issues with the component files

Troubleshooting Already Tried
✅ Multiple CLI versions (4.18.0, 4.17.0, 4.16.0)

✅ Fresh installation attempts

✅ npx shadcn@latest with and without version pinning

Question
Is there a specific compatibility requirement or known issue with the @react-bits/Lanyard-JS-CSS component? The component name suggests it might be a CSS/JS hybrid, which could be causing parsing issues.

Validations

  • I have checked other issues to see if my issue was already reported or addressed

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions