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
Closed

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

camille-hdl opened this issue Feb 22, 2019 · 4 comments

Comments

@camille-hdl
Copy link

@camille-hdl camille-hdl commented Feb 22, 2019

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

This comment has been minimized.

Copy link
Author

@camille-hdl camille-hdl commented Feb 24, 2019

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

@lukastaegert

This comment has been minimized.

Copy link
Member

@lukastaegert lukastaegert commented Feb 25, 2019

Fix at #2719

@camille-hdl

This comment has been minimized.

Copy link
Author

@camille-hdl camille-hdl commented Feb 25, 2019

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
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.