Skip to content
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

[bug]: monorepo CLI fails to create project BUN #6145

Open
2 tasks done
JJozef opened this issue Dec 21, 2024 · 2 comments
Open
2 tasks done

[bug]: monorepo CLI fails to create project BUN #6145

JJozef opened this issue Dec 21, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@JJozef
Copy link

JJozef commented Dec 21, 2024

Describe the bug

When attempting to create a new Next.js monorepo project using the shadcn CLI (canary version), the process fails due to missing workspace dependencies.

Affected component/components

CLI

How to reproduce

Steps to Reproduce

  1. Run the following command: bunx --bun shadcn@canary init
  2. Choose "Next.js (Monorepo)" when prompted to start a new project
  3. Enter a project name (e.g., "test-monorp-shadcn")

Expected Behavior

The CLI should successfully create a new Next.js monorepo project with all necessary dependencies and configurations.

Actual Behavior

The CLI fails to create the project, reporting missing workspace dependencies:

✖ Something went wrong creating a new Next.js monorepo.
Something went wrong. Please check the error below for more details.
If the problem persists, please open an issue on GitHub.

# Logs section...

Codesandbox/StackBlitz link

No response

Logs

PS C:\Users\Jozef\Desktop> bunx --bun shadcn@canary init
√ The path C:\Users\Jozef\Desktop does not contain a package.json file.
  Would you like to start a new project? » Next.js (Monorepo)
√ What is your project named? ... test-monorp-shadcn
✖ Something went wrong creating a new Next.js monorepo.
Something went wrong. Please check the error below for more details.
If the problem persists, please open an issue on GitHub.

Command failed with exit code 1: bun install
error: Workspace dependency "@workspace/eslint-config" not found

Searched in "..\..\..\..\..\C:\Users\Jozef\Desktop\test-monorp-shadcn\*"

Workspace documentation: https://bun.sh/docs/install/workspaces


error: Workspace dependency "@workspace/typescript-config" not found

Searched in "..\..\..\..\..\C:\Users\Jozef\Desktop\test-monorp-shadcn\*"

Workspace documentation: https://bun.sh/docs/install/workspaces

error: @workspace/eslint-config@* failed to resolve
error: @workspace/typescript-config@* failed to resolve
bun install v1.1.42 (50eec002)

System Info

- Operating System: Windows 11 version 23H2 (SO 22631.4602)
- Node.js version: v22.11.0
- Bun version: 1.1.42
- shadcn CLI version: canary

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@JJozef JJozef added the bug Something isn't working label Dec 21, 2024
@JJozef JJozef changed the title [bug]: monorepo CLI fails to create project [bug]: monorepo CLI fails to create project BUN Dec 21, 2024
@abhishekmmgn
Copy link

abhishekmmgn commented Dec 22, 2024

Yup. Same error on Linux. The error only occurs when selected Next.js (Monorepo).

@ghost
Copy link

ghost commented Dec 22, 2024

When using NPM, a similar error occurs, as it uses a package.json file following the PNPM standard, where imports are defined with "workspace:*". However, for NPM, it should be "*".

> npx shadcn@canary init
✔ The path /home/william/github does not contain a package.json file.
  Would you like to start a new project? › Next.js (Monorepo)
✔ What is your project named? … shadcn
✖ Something went wrong creating a new Next.js monorepo.
Something went wrong. Please check the error below for more details.
If the problem persists, please open an issue on GitHub.

Command failed with exit code 1: npm install
npm error code EUNSUPPORTEDPROTOCOL
npm error Unsupported URL Type "workspace:": workspace:*
npm error A complete log of this run can be found in: /home/william/.npm/_logs/2024-12-22T15_42_12_265Z-debug-0.log

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

No branches or pull requests

2 participants