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

Code splitting : Identifier 'React' has already been declared #2715

Closed
camille-hdl opened this issue Feb 22, 2019 · 4 comments · Fixed by #2719
Closed

Code splitting : Identifier 'React' has already been declared #2715

camille-hdl opened this issue Feb 22, 2019 · 4 comments · Fixed by #2719

Comments

@camille-hdl
Copy link

Hello

  • Rollup Version: 1.2.2
  • Operating System (or Browser): Chrome 72 on MacOS 10.14.11
  • Node Version: 11.6.0

How Do We Reproduce?

https://github.com/camille-hdl/rollup-starter-code-splitting

(instructions in the readme)

  • Dynamically import a component (that imports React) from another file that also imports React,
  • Build the application, run it in the browser.

Expected Behavior

React is not aliased twice, the page works.

Actual Behavior

In the output, React is aliased twice in a import statement:

import { ..., d as React, e as require$$1, f as require$$2, g as React } from './chunk....js';

resulting in the following error message in the console:

Uncaught (in promise) SyntaxError: Identifier 'React' has already been declared
@camille-hdl
Copy link
Author

update : it seems the issue is not present in older versions of rollup (it worked with 1.0.1)

@lukastaegert
Copy link
Member

Fix at #2719

@camille-hdl
Copy link
Author

that was fast ! thank you 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants