Description
After installing @dannote/figma-use globally with bun, running figma-use fails with a module not found error
pointing to a TypeScript source file that isn't included in the published package.
Steps to Reproduce
bun install -g @dannote/figma-use
figma-use
The Error
error: Module not found "/Users/<user>/node_modules/@dannote/figma-use/packages/cli/src/index.ts"
Workaround
I got claude code to fix this with the following
Patch ~/node_modules/@dannote/figma-use/bin/figma-use.js to use the compiled output:
#!/usr/bin/env bun
import { spawn } from 'child_process'
import { fileURLToPath } from 'url'
import { dirname, join } from 'path'
const __dirname = dirname(fileURLToPath(import.meta.url))
const cliPath = join(__dirname, '..', 'dist', 'cli', 'index.js')
const child = spawn('bun', ['run', cliPath, ...process.argv.slice(2)], { stdio: 'inherit' })
child.on('exit', (code) => process.exit(code || 0))
This resolves the issue and the CLI works as expected.
Environment
- Package version: 0.6.0
- bun: 1.3.6
- OS: macOS
Description
After installing
@dannote/figma-useglobally with bun, runningfigma-usefails with a module not found errorpointing to a TypeScript source file that isn't included in the published package.
Steps to Reproduce
The Error
Workaround
I got claude code to fix this with the following
Patch ~/node_modules/@dannote/figma-use/bin/figma-use.js to use the compiled output:
This resolves the issue and the CLI works as expected.
Environment