[Typescript] Options type is not exported
See original GitHub issueHi,
I used the @types/http-proxy-middleware which expord a Config
type. When i upgrade to the last version of http-proxy-middleware, i have the following error with this code:
import createProxyMiddleware, { Options } from 'http-proxy-middleware';
TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.
Can you export the Options type in index.d.ts
?
Regards
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Typescript errors when importing a "not exported" type, even ...
Typescript 3.8 introduces new syntax for type-only imports and exports: import type T from './module'; import type { A, B } from '....
Read more >Documentation - TypeScript 3.8
import type only imports declarations to be used for type annotations and declarations. It always gets fully erased, so there's no remnant of...
Read more >types exported via 'export type' not resolved : WEB-16894
Typescript : types exported via 'export type' not resolved ; import BlahModule = ; ( ; /BlahModule') ;; export class ; Yo { ......
Read more >How to export a Type in TypeScript | bobbyhadz
Use a named export to export a type in TypeScript, e.g. export type Person = {} . The exported type can be imported...
Read more >Avoid Export Default - TypeScript Deep Dive - Gitbook
If you refactor Foo in foo.ts it will not rename it in bar.ts . · If you end up needing to export more...
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
Published version
v1.0.0
to npm More details: https://github.com/chimurai/http-proxy-middleware/releases@bender316
RequestHandler
is now exported also. (removed theI
prefix from interface name)Thanks for reporting the issue! Hope it didn’t cause too much inconvenience.
Hi I’m not sure if this is relevant but webpack-dev-server is kicking up a fuss with ‘node_modules/http-proxy-middleware/dist/index"’ has no exported member ‘Config’.’ Here is my tsconfig: