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

Add an explicit export default for compatibility with esbuild #3783

Merged
merged 2 commits into from Oct 30, 2022

Conversation

Verseth
Copy link
Contributor

@Verseth Verseth commented Oct 29, 2022

Hi, as I tried to switch from react to preact in my project which uses esbuild I encountered an error caused by a lack of explicit default exports.

✘ [ERROR] No matching export in "node_modules/react-dom/client.mjs" for import "default"

frontend/build/index.js:6:7:
6 │ import ReactDOM from 'react-dom/client'
╵ ~~~~~~~~

1 error

This was the only thing I had to change to make my app work.
Hope this will make someone's transition more seamless.

Copy link
Member

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, that's a good catch! Let's add a quick test in this file so that we ensure that we don't ever regress on this in the future and then it's ready to be merged 🎉

@coveralls
Copy link

coveralls commented Oct 29, 2022

Coverage Status

Coverage remained the same at 99.531% when pulling 50d3837 on Verseth:explicit_default_export into 2a3b1aa on preactjs:master.

Copy link
Member

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet! Thank you so much for the PR 👍

@marvinhagemeister marvinhagemeister merged commit a31e564 into preactjs:master Oct 30, 2022
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.

None yet

3 participants