Skip to content
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

Document CJS/ESM footgun on future common errors page #1236

Open
nwalters512 opened this issue Feb 13, 2025 · 0 comments
Open

Document CJS/ESM footgun on future common errors page #1236

nwalters512 opened this issue Feb 13, 2025 · 0 comments

Comments

@nwalters512
Copy link

From #1234. Once a page to document common errors exists, document the fact that using Preact in a mixed CJS/ESM Node codebase requires a bundler. Here's the text I had suggested elsewhere:

Preact is not recommended for use in a mixed CJS/ESM codebase running directly in Node without a bundler, as there's a risk that Preact's singletons could be loaded twice. If your first-party code or any dependencies will try to load both the CJS and ESM versions of Preact, you must use a bundler to alias imports of Preact to always resolve to either the CJS or ESM versions.

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

No branches or pull requests

1 participant