Skip to content

fix: use symlink instead of NODE_PATH for ESM dependency resolution#41

Merged
yepzdk merged 1 commit into
mainfrom
feature/fix-esm-dependency-resolution
Apr 21, 2026
Merged

fix: use symlink instead of NODE_PATH for ESM dependency resolution#41
yepzdk merged 1 commit into
mainfrom
feature/fix-esm-dependency-resolution

Conversation

@yepzdk
Copy link
Copy Markdown
Collaborator

@yepzdk yepzdk commented Apr 21, 2026

Summary

  • NODE_PATH is completely ignored by Node.js ES modules — the existing env.NODE_PATH in the MCP server config had no effect, causing dependency resolution to fail
  • The SessionStart hook now symlinks ${CLAUDE_PLUGIN_ROOT}/node_modules${CLAUDE_PLUGIN_DATA}/node_modules so ESM resolution finds packages in the standard location
  • Removed the non-functional env.NODE_PATH from the MCP server config

Test plan

  • Install plugin via claude plugin add in a fresh project
  • Verify the symlink is created at ${CLAUDE_PLUGIN_ROOT}/node_modules on session start
  • Verify the MCP server starts successfully and tools respond (e.g. get_connection_status)
  • Verify html2canvas resolves correctly via createRequire (test /html2canvas.min.js endpoint)

🤖 Generated with Claude Code

NODE_PATH is completely ignored by Node.js ES modules. Replace the
non-functional env.NODE_PATH in the MCP server config with a symlink
created by the SessionStart hook that places node_modules in the
plugin root where ESM resolution expects it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@yepzdk yepzdk merged commit 8ab8ca8 into main Apr 21, 2026
1 check passed
@yepzdk yepzdk deleted the feature/fix-esm-dependency-resolution branch April 21, 2026 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant