ui: [bug]: error: Cannot find module '@jridgewell/gen-mapping' from '/private/tmp/bunx-501-shadcn@latest/node_modules/@babel/generator/lib/source-map.js'
Describe the bug
I prompted v0.dev to create a starter template and I copied the command and changed the npx to bunx --bun and ran it only to find this error
error: Cannot find module '@jridgewell/gen-mapping' from '/private/tmp/bunx-501-shadcn@latest/node_modules/@babel/generator/lib/source-map.js'
I only just installed bun so maybe I didn’t configure something write. bunx works for other things like bunx --bun prettier foo.js so I’m sure the problem is a shadcn@latest one.
Any help would be appreciated thank you.
Affected component/components
Shadcn CLI
How to reproduce
- Install bun
- in the terminal run bunx --bun shadcn@latest init
Codesandbox/StackBlitz link
not applicable
Logs
error: Cannot find module '@jridgewell/gen-mapping' from '/private/tmp/bunx-501-shadcn@latest/node_modules/@babel/generator/lib/source-map.js'
System Info
┌─────────────────────────────────────────────────────────────────────────────────────────┐
│ SYSTEMINFORMATION Version: 5.23.8 │
└─────────────────────────────────────────────────────────────────────────────────────────┘
Operating System:
──────────────────────────────────────────────────────────────────────────────────────────
Platform : darwin
Distro : macOS
Release : 15.1.1
Codename : macOS Sequoia
Kernel : 24.1.0
Arch : arm64
Hostname : Olalekans-MacBook-Pro.local
Codepage : UTF-8
Build : 24B91
System:
──────────────────────────────────────────────────────────────────────────────────────────
Manufacturer : Apple Inc.
Model : MacBookPro
Version : 18,3
Virtual :
CPU:
──────────────────────────────────────────────────────────────────────────────────────────
Manufacturer : Apple
Brand : M1 Pro
Family : 458787763
Model :
Stepping : 4
Speed : 2.4
Cores : 8
PhysicalCores : 8
PerformanceCores : 6
EfficiencyCores : 2
Processors : 1
Socket : SOC
Before submitting
- I’ve made research efforts and searched the documentation
- I’ve searched for existing issues
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 7
- Comments: 34
Downgrading it back to
@jridgewell/gen-mapping@0.3.5works as far as it seems.New version v0.3.7 is woking now.
this worked for me
New version published
v0.3.7https://github.com/jridgewell/sourcemaps/issues/10#issuecomment-2530804362Same issue on macOS. Tried Node 18 and 22 with both npx and ynpx.
EDIT: It works with Node v20. EDIT(2): Talked too soon. Started spitting out the same error after init.