Skip to content

fix react-dom imports#74

Merged
ryanflorence merged 1 commit intoreach:masterfrom
kentcdodds:pr/fix-react-dom-imports
Oct 5, 2018
Merged

fix react-dom imports#74
ryanflorence merged 1 commit intoreach:masterfrom
kentcdodds:pr/fix-react-dom-imports

Conversation

@kentcdodds
Copy link
Copy Markdown

react-dom does not use named exports and when rollup attempts to bundle
these files it gives the following error:

[!] Error: 'render' is not exported by ../../node_modules/react-dom/index.js
https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module
node_modules/@reach/alert/es/index.js (19:9)
17:
18: import React from "react";
19: import { render } from "react-dom";
             ^
20: import Component from "@reach/component-component";
21: import VisuallyHidden from "@reach/visually-hidden";

react-dom does not use named exports and when rollup attempts to bundle
these files it gives the following error:

```
[!] Error: 'render' is not exported by ../../node_modules/react-dom/index.js
https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module
node_modules/@reach/alert/es/index.js (19:9)
17:
18: import React from "react";
19: import { render } from "react-dom";
             ^
20: import Component from "@reach/component-component";
21: import VisuallyHidden from "@reach/visually-hidden";
```
@ryanflorence
Copy link
Copy Markdown
Member

Huh... well alright.

@ryanflorence ryanflorence merged commit 2a20f45 into reach:master Oct 5, 2018
@kentcdodds kentcdodds deleted the pr/fix-react-dom-imports branch October 5, 2018 22:09
@TrySound
Copy link
Copy Markdown

TrySound commented Oct 9, 2018

@kentcdodds You could just specify namedExports in commonjs plugin.

@kentcdodds
Copy link
Copy Markdown
Author

Yeah, should've done that. But my preferred solution would be: facebook/react#13272

@TrySound
Copy link
Copy Markdown

TrySound commented Oct 9, 2018

Work in progress in facebook/react#13321

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.

3 participants