MunifTanjim / node-bitbucket

Bitbucket API client for Browser and Node.js
https://bitbucketjs.netlify.app
MIT License
106 stars 28 forks source link

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

Closed binary64 closed 4 years ago

binary64 commented 4 years ago

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 commented 4 years ago

@binary64 Fix should be published with v2.2.0 :tada:

binary64 commented 4 years ago

You nailed it. Thanks!