Duplicate declaration "Component"
See original GitHub issueDescribe the bug
When ever I run webpack it gives me Duplicate declaration "Component"
in the generated-models.tsx file
To Reproduce Steps to reproduce the behavior:
- Any generated-models.tsx
- Run with webpack & babel typescript preset
- Run the following command:
gql-gen ...
Expected behavior
Would be not to have generated-models.tsx: Duplicate declaration "Component"
Environment:
- OS: Mac OS Sierra
- Codegen: 0.15.2
- Node: v8.12.0
UPDATE: I also tried ts-loader instead of babel-loader & it gave me
TS2345: Argument of type '{ new (): Document; prototype: Document; }' is not assignable to parameter of type 'DocumentNode'.
Type '{ new (): Document; prototype: Document; }' is missing the following properties from type 'DocumentNode': kind, definitions
UPDATE: I got ts-loader to work & compile with another generate. Babel typescript preset doesn’t support namespaces so I think that’s why it doesn’t work.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
reactjs - Duplicate declaration "Form" - React - Stack Overflow
I'm using React with two different components: Formsy and React Router Form. ... Duplicate declaration "Form" while parsing file: C:\Users.
Read more >Duplicate declaration in current scope | Microsoft Learn
In this article. Check the current procedure, module, or project and remove any duplicate declarations. A Const statement uses the same name as ......
Read more >Duplication declaration error fix? - MIT App Inventor Help
I've been trying to get my project on my phone but the duplication declaration error won't let me.
Read more >Module Build Failed: Duplicate Declaration "Editor"-Reactjs
Coding example for the question Module Build Failed: Duplicate Declaration "Editor"-Reactjs.
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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@dragonfire1119 im running into the same issue…
Duplicate declaration "Document"
How did you get around this? do you mind providing more details?
@harrisrobin You can use
noNamepsaces
configuration and the output will work with CRA (see https://graphql-code-generator.com/docs/integrations/create-react-app)