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

docs: Warn about using Preact in mixed CJS/ESM codebase without bundler #1234

Closed

Conversation

nwalters512
Copy link

I proposed this in preactjs/preact#4648 but didn't hear back from a maintainer one way or another. I'm hoping to have a discussion about how to document this, as this was a really frustrating thing to discover independently.

@rschristian
Copy link
Member

As mentioned, I think a variation of this would belong on a "Common Errors" page, rather than in our "Getting Started" docs, but unfortunately we don't have a page like that quite yet.

Might be better to convert this into an issue, we'll address it with docs when we can.

Thanks

@nwalters512
Copy link
Author

I'm likely biased because I faced this issue, but this feels like critical information to convey at the point when someone is first figuring out how to configure Preact in their project. While I understand you may have good reasons that you can't fix this, the fact that Preact functions differently than most other dependencies is relevant upfront, not just when an error has already been encountered.

@rschristian
Copy link
Member

Sorry, but we see this as a problem specific to runtimes and it is one that does affect many other packages. The bar for putting a warning right on our 'Getting Started', page which essentially amounts to "Use at your own risk", is exceptionally high and we feel hasn't been met here. It'd also be fairly odd to add this years after the fact when Node hasn't made things any worse than they have been.

Warnings for usage errors don't really belong on the first pages someone is likely to see, as these tend to be just as much for marketing as they are informational. I'm sorry that was a dealbreaker for you and sorry you spent time on an integration that wasn't going to work, but this information belongs elsewhere in our opinion.

As mentioned, feel free to open an issue for tracking if you'd like, else, it's something we're aware of and will keep in mind for if we do add a 'Common Errors'-type page.

Thanks,

@nwalters512 nwalters512 deleted the node-mixed-cjs-esm-codebase branch February 13, 2025 23:31
@nwalters512
Copy link
Author

#1236

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.

2 participants