Skip to content

[BUG] Build error: duplicate createRequire imports prevent daemon startup #67838

@cristinac-max

Description

@cristinac-max

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

The Claude-to-IM bridge fails to start with a duplicate import error in the built daemon.

What Should Happen?

Should be able to run my configuration

Error Messages/Logs

### Error Message
SyntaxError: Identifier 'createRequire' has already been declared
    at file:///Users/cristinac/.agents/skills/claude-to-im/dist/daemon.mjs:13
    import { createRequire } from "module";
           ^^^^^^^^^^^^^

Steps to Reproduce

  1. Run /claude-to-im setup and configure Feishu (or any channel)
  2. Run /claude-to-im start
  3. Observe the build error

Claude Model

Not sure / Multiple models

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

2.1.175

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

The built dist/daemon.mjs has duplicate imports:

  • Line 1: import { createRequire } from 'module';
  • Line 13: import { createRequire } from "module"; (duplicate)

This causes Node.js to reject the module as invalid. The issue appears to be in the build tooling (likely esbuild or tsx configuration) that generates the daemon bundle.

Attempted Fixes

  • npm install in the skill directory
  • npm run build to rebuild the daemon
  • ✅ Both .claude and .agents skill directories exhibit the same issue
  • ❌ Manual removal of duplicate imports didn't fully resolve the underlying build problem

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:skillsbugSomething isn't workingplatform:macosIssue specifically occurs on macOS

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions