Skip to content

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

@nwalters512

Description

@nwalters512

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions