Getting build errors on TS on polka dot module

Hi,
I am getting compilation errors with running yarn build, error info below
node_modules/@polkadot/api-derive/democracy/types.d.ts:1:13 - error TS1005: ‘=’ expected.

1 import type BN from 'bn.js';
              ~~

node_modules/@polkadot/api-derive/democracy/types.d.ts:1:16 - error TS1005: ';' expected.

1 import type BN from 'bn.js';
                 ~~~~

node_modules/@polkadot/api-derive/democracy/types.d.ts:1:21 - error TS1005: ';' expected.

1 import type BN from 'bn.js';
                      ~~~~~~~

node_modules/@polkadot/api-derive/staking/types.d.ts:1:13 - error TS1005: '=' expected.

1 import type BN from 'bn.js';
              ~~

node_modules/@polkadot/api-derive/staking/types.d.ts:1:16 - error TS1005: ';' expected.

1 import type BN from 'bn.js';
                 ~~~~

node_modules/@polkadot/api-derive/staking/types.d.ts:1:21 - error TS1005: ';' expected.

1 import type BN from 'bn.js';
                      ~~~~~~~

node_modules/@polkadot/api-derive/type/HeaderExtended.d.ts:10:5 - error TS1127: Invalid character.

10     #private;
       

node_modules/@polkadot/api-derive/type/SignedBlockExtended.d.ts:10:5 - error TS1127: Invalid character.

10     #private;
       

node_modules/@polkadot/api-derive/types.d.ts:1:13 - error TS1005: '=' expected.

1 import type BN from 'bn.js';
              ~~

node_modules/@polkadot/api-derive/types.d.ts:1:16 - error TS1005: ';' expected.

1 import type BN from 'bn.js';
                 ~~~~

node_modules/@polkadot/api-derive/types.d.ts:1:21 - error TS1005: ';' expected.

1 import type BN from 'bn.js';
                      ~~~~~~~

node_modules/@polkadot/api/base/Decorate.d.ts:14:5 - error TS1127: Invalid character.

14     #private;
       

node_modules/@polkadot/api/base/Events.d.ts:3:5 - error TS1127: Invalid character.

3     #private;
      

node_modules/@polkadot/api/base/Init.d.ts:5:5 - error TS1127: Invalid character.

5     #private;
      

node_modules/@polkadot/api/promise/Api.d.ts:93:5 - error TS1127: Invalid character.

93     #private;
       

node_modules/@polkadot/api/promise/Combinator.d.ts:8:5 - error TS1127: Invalid character.

8     #private;
      

node_modules/@polkadot/api/rx/Api.d.ts:107:5 - error TS1127: Invalid character.

107     #private;
        

node_modules/@polkadot/api/types/base.d.ts:1:13 - error TS1005: '=' expected.

1 import type { Observable } from 'rxjs';
              ~

node_modules/@polkadot/api/types/base.d.ts:1:33 - error TS1005: ';' expected.

1 import type { Observable } from 'rxjs';
                                  ~~~~~~

node_modules/@polkadot/api/types/index.d.ts:2:13 - error TS1005: '=' expected.

2 import type BN from 'bn.js';
              ~~

node_modules/@polkadot/api/types/index.d.ts:2:16 - error TS1005: ';' expected.

2 import type BN from 'bn.js';
                 ~~~~

node_modules/@polkadot/api/types/index.d.ts:2:21 - error TS1005: ';' expected.

2 import type BN from 'bn.js';
                      ~~~~~~~

node_modules/@polkadot/keyring/keyring.d.ts:21:5 - error TS1127: Invalid character.

21     #private;
       

node_modules/@polkadot/metadata/Metadata/MetadataVersioned.d.ts:11:5 - error TS1127: Invalid character.

11     #private;
       

node_modules/@polkadot/rpc-core/index.d.ts:28:5 - error TS1127: Invalid character.

28     #private;
       

node_modules/@polkadot/rpc-provider/http/index.d.ts:23:5 - error TS1127: Invalid character.

23     #private;
       

node_modules/@polkadot/rpc-provider/ws/Provider.d.ts:27:5 - error TS1127: Invalid character.

27     #private;
       

node_modules/@polkadot/types/codec/AbstractInt.d.ts:12:5 - error TS1127: Invalid character.

12     #private;
       

node_modules/@polkadot/types/codec/BTreeSet.d.ts:4:5 - error TS1127: Invalid character.

4     #private;
      

node_modules/@polkadot/types/codec/Compact.d.ts:20:5 - error TS1127: Invalid character.

20     #private;
       

node_modules/@polkadot/types/codec/Enum.d.ts:13:5 - error TS1127: Invalid character.

13     #private;
       

node_modules/@polkadot/types/codec/Map.d.ts:4:5 - error TS1127: Invalid character.

4     #private;
      

node_modules/@polkadot/types/codec/Option.d.ts:12:5 - error TS1127: Invalid character.

12     #private;
       

node_modules/@polkadot/types/codec/Set.d.ts:12:5 - error TS1127: Invalid character.

12     #private;
       

node_modules/@polkadot/types/codec/Struct.d.ts:23:5 - error TS1127: Invalid character.

23     #private;
       

node_modules/@polkadot/types/create/registry.d.ts:5:5 - error TS1127: Invalid character.

5     #private;
      

node_modules/@polkadot/types/generic/Event.d.ts:14:5 - error TS1127: Invalid character.

14     #private;
       

node_modules/@polkadot/types/primitive/Text.d.ts:12:5 - error TS1127: Invalid character.

12     #private;
       

node_modules/@polkadot/types/types/index.d.ts:10:1 - error TS1128: Declaration or statement expected.

10 export type { Observable } from 'rxjs';
   ~~~~~~

node_modules/@polkadot/types/types/index.d.ts:10:13 - error TS1005: ';' expected.

10 export type { Observable } from 'rxjs';
               ~

node_modules/@polkadot/types/types/index.d.ts:10:33 - error TS1005: ';' expected.

10 export type { Observable } from 'rxjs';
                                   ~~~~~~

node_modules/@polkadot/types/types/interfaces.d.ts:1:13 - error TS1005: '=' expected.

1 import type BN from 'bn.js';
              ~~

node_modules/@polkadot/types/types/interfaces.d.ts:1:16 - error TS1005: ';' expected.

1 import type BN from 'bn.js';
                 ~~~~

node_modules/@polkadot/types/types/interfaces.d.ts:1:21 - error TS1005: ';' expected.

1 import type BN from 'bn.js';
                      ~~~~~~~

node_modules/@polkadot/types/types/registry.d.ts:1:13 - error TS1005: '=' expected.

1 import type BN from 'bn.js';
              ~~

node_modules/@polkadot/types/types/registry.d.ts:1:16 - error TS1005: ';' expected.

1 import type BN from 'bn.js';
                 ~~~~

node_modules/@polkadot/types/types/registry.d.ts:1:21 - error TS1005: ';' expected.

1 import type BN from 'bn.js';
                      ~~~~~~~

node_modules/@polkadot/util-crypto/key/DeriveJunction.d.ts:1:13 - error TS1005: '=' expected.

1 import type BN from 'bn.js';
              ~~

node_modules/@polkadot/util-crypto/key/DeriveJunction.d.ts:1:16 - error TS1005: ';' expected.

1 import type BN from 'bn.js';
                 ~~~~

node_modules/@polkadot/util-crypto/key/DeriveJunction.d.ts:1:21 - error TS1005: ';' expected.

1 import type BN from 'bn.js';
                      ~~~~~~~

node_modules/@polkadot/util-crypto/key/DeriveJunction.d.ts:3:5 - error TS1127: Invalid character.

3     #private;
      

node_modules/@polkadot/util/types.d.ts:1:13 - error TS1005: '=' expected.

1 import type BN from 'bn.js';
              ~~

node_modules/@polkadot/util/types.d.ts:1:16 - error TS1005: ';' expected.

1 import type BN from 'bn.js';
                 ~~~~

node_modules/@polkadot/util/types.d.ts:1:21 - error TS1005: ';' expected.

1 import type BN from 'bn.js';