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

Webpack error: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type' #61

Closed
binary64 opened this issue May 22, 2020 · 2 comments

Comments

@binary64
Copy link

I get many of these errors (I'm on Typescript 3.9.3 and nextjs latest)

Creating an optimized production build

Failed to compile.

C:/p/myapp/node_modules/bitbucket/src/plugins/auth/types.ts
ERROR in C:/p/myapp/node_modules/bitbucket/src/plugins/auth/types.ts(1,10):
1:10 Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
  > 1 | export { Options } from '../../client/types'
      |          ^
    2 | export { RequestOptions } from '../../endpoint/types'
    3 | 
    4 | export type APIClient = import('../../client/types').APIClient


> Build error occurred
Error: > Build failed because of webpack errors

It seems the solution is to change those "export" to "export type" throughout your codebase.

@MunifTanjim
Copy link
Owner

@binary64 Fix should be published with v2.2.0 🎉

@binary64
Copy link
Author

You nailed it. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants