question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Duplicate declaration "React"

See original GitHub issue

I’m using this plugin with next.js, which uses babel-plugin-react-require . It seems that the changes in 3bab74c5587d33892fd2cb409df2ae3fad641b6e are conflicting with that. So now I get this:

Module build failed: TypeError: unknown: Duplicate declaration "React"
   5 | import _inherits from 'babel-runtime/helpers/inherits';
   6 | import React from 'react';
>  7 | import React from 'react';
     |        ^

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:9
  • Comments:33

github_iconTop GitHub Comments

10reactions
ljharbcommented, Nov 7, 2017

The next/babel preset includes https://unpkg.com/next@4.1.4/dist/server/build/babel/preset.js which uses babel-plugin-react-require - which has a bug, as documented above.

This issue should be closed, and an issue filed on https://github.com/vslinko/babel-plugin-react-require instead.

6reactions
JuanCaicedocommented, Nov 7, 2017

I downgraded to v0.4.0 and this solved the problem. Not sure if the plugin is working well yet though

Read more comments on GitHub >

github_iconTop Results From Across the Web

reactjs - Duplicate declaration "Form" - React - Stack Overflow
Both have component class called Form so, gulp returns in console the following error messsage: Duplicate declaration "Form" while parsing file: ...
Read more >
React-Redux import : duplicate declaration ? : r/reactjs - Reddit
Hi guys ! I'm a beginner in Redux and when trying to import a component I created, I have this error : Duplicate...
Read more >
Module Build Failed: Duplicate Declaration "Editor"-Reactjs
Coding example for the question Module Build Failed: Duplicate Declaration "Editor"-Reactjs.
Read more >
A brand new website interface for an even better experience!
Duplicate declaration "React"
Read more >
Reactjs – Duplicate declaration “Form” – React - iTecNote
Reactjs – Duplicate declaration “Form” – React. react-nativereact-routerreactjs. I'm using React with two different components: Formsy and React Router Form ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found