Typescript build error
See original GitHub issueHi, actually i implemented react-select into an typescript application and after adding the needed components for an auto-suggest Element with material-ui, i get this build error from typescript:
ERROR in ./node_modules/react-select/src/components/Menu.js 5:7
Module parse failed: Unexpected token (5:7)
You may need an appropriate loader to handle this file type.
| import {
| Component,
> type Element as ReactElement,
| type ElementRef,
| type Node,
Issue Analytics
- State:
- Created 4 years ago
- Reactions:19
- Comments:9
Top Results From Across the Web
Typescript build error - what is wrong with this? - Stack Overflow
I have recently updated VS2017 and I am seeing a lot of typescript build errors. The errors are all the same, and all...
Read more >Documentation - Understanding Errors - TypeScript
Whenever TypeScript finds an error, it tries to explain what went wrong in as much detail as possible. Because its type system is...
Read more >Stopping a TypeScript Build When Errors Are Found
TypeScript will always compile even if there are ridiculous errors in your project. This lesson shows how to configure your .tsconfig with "noEmitOnError" ......
Read more >TypeScript errors and how to fix them
Common Errors. Below you find a list of common TypeScript errors along with the buggy code and its fixed version. If you're interested...
Read more >Avoid TypeScript errors in your project by using the TypeScript ...
No more unexpected type errors! ... Assuming you are new to TypeScript, tsc is The TypeScript Compiler. It is a tool responsible for...
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
I’ve encountered a similar issue when TS tooling auto-imported
Select
fromreact-select/src/Select
, it can be fixed by importing fromreact-select
instead. But the fact that the tooling can be confused like that is somewhat inconvenient =(Got lots of compile errors after upgrade to v3. Is there a reason why you moved types in @types/react-select package to
src
instead of keeping it underlib
?I referenced some of your types outside
index.d.ts
in my code - it’s not ideal, as not part of the public types API, but it is what it is. Example:Problem with
src
is TypeScript lookup: If I wantGroupType
orGroupedOptionsType
from@types\react-select\src\types.d.ts
, the sources fromreact-select\src\types.js
are instead selected due to higher lookup priority in TypeScript. This file contains flow types, which break my webpack build that can only handle TypeScript and complains about unexpected token.