-
-
Notifications
You must be signed in to change notification settings - Fork 600
fix: Use Node.js crypto.randomUUID() for Node and React Native builds to fix uuid v13 ESM compatibility #2805
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
fix: Use Node.js crypto.randomUUID() for Node and React Native builds to fix uuid v13 ESM compatibility #2805
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
…ESM compatibility Co-authored-by: mtrezza <5673677+mtrezza@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot The CI still doesn't pass |
…gration tests Co-authored-by: mtrezza <5673677+mtrezza@users.noreply.github.com>
Fixed in commit edd97a1. The issue was that |
358e8a6
into
dependabot/npm_and_yarn/uuid-13.0.0
Pull Request
Issue
Closes: #2770
Approach
The uuid v13 package is ESM-only and cannot be loaded via CommonJS
require(). Integration tests fail withERR_REQUIRE_ESMbecause Babel compiles ES imports torequire()calls which execute unconditionally.Solution: Use conditional
require()calls at runtime so dead code elimination removes them per build target:crypto.randomUUID()(built-in since Node 14.17.0)crypto.randomUUID()(integration tests run in Node.js environment)uuid.v4packageCompiled Node and React Native outputs now contain only
require('crypto').randomUUIDwith no uuid package dependency.Tasks
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.