Skip to content

Typescript build fails when using isolatedModules flag #609

@jrbarnard

Description

@jrbarnard

What I wanted to do

I tried to build a project using this lib with typescript. I have the isolatedModules flag set to true due to the use of babel.

What I expected to happen

It to build correctly

What actually happened

I got the error:

../node_modules/@optimizely/optimizely-sdk/lib/core/event_processor/index.ts:25:10
Type error: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.

  23 | }
  24 | 
> 25 | export { EventProcessor, LocalStoragePendingEventsDispatcher } from '@optimizely/js-sdk-event-processor';
     |          ^
  26 | 
  27 | export default { createEventProcessor, LocalStoragePendingEventsDispatcher };

Steps to reproduce

SDK version: 3.2.2
Node version: v12.18.0
NPM version: 6.14.4
Typescript version: 3.9.7

Use tsconfig with isolatedModules set to true
Run tsc
See error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions