Skip to content

Re-consider or documentpolygen-metro-config being an ESM target #86

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

Closed
kraenhansen opened this issue Dec 20, 2024 · 0 comments · Fixed by #95
Closed

Re-consider or documentpolygen-metro-config being an ESM target #86

kraenhansen opened this issue Dec 20, 2024 · 0 comments · Fixed by #95

Comments

@kraenhansen
Copy link
Collaborator

kraenhansen commented Dec 20, 2024

The "require(esm)" feature of Node.js being enabled by default is fairly recent and Metro doesn't support ESM configs yet.

Metro loads the "polygen-metro-config" from a CJS context (at least in the Example app). Either these packages shouldn't be "type": "module" (polygen-metro-config and polygen-core-build) or there should be a loud note about running the latest versions of Node in the README or some FAQ. Another alternative would be to add a .cjs wrapper of your ESM code and throwing a nice error urging users to upgrade.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants