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

fix: namedExport of react-dom/server.js #885

Merged

Conversation

MoonBall
Copy link
Contributor

@MoonBall MoonBall commented Aug 23, 2020

Steps to Reproduce

  1. npx create-snowpack-app snowpack-react --template @snowpack/app-template-react --use-yarn
  2. cd snowpack-react
  3. modify src/App.jsx. see code
  4. yarn start

Browser's console will print an error.

Uncaught SyntaxError: The requested module '/web_modules/react-dom/server.js' does not provide an export named 'renderToString'

Changes

The element of autoDetectPackageExports is a file name if it ends with .js rather than index.js.

Before modify: isAutoDetect('react-dom/server.js') returns false.
After modify: isAutoDetect('react-dom/server.js') returns true.

Testing

Test added.

@MoonBall MoonBall requested a review from a team as a code owner August 23, 2020 09:37
@vercel
Copy link

vercel bot commented Aug 23, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pikapkg/snowpack/acittkhz5
✅ Preview: https://snowpack-git-fork-moonball-fix-react-dom-serverjs-namedexport.pikapkg.vercel.app

Copy link
Owner

@FredKSchott FredKSchott left a comment

Choose a reason for hiding this comment

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

Nice! Good catch

@FredKSchott FredKSchott merged commit db68e22 into FredKSchott:master Aug 23, 2020
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

2 participants