Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

Unable to use Stardust in TS project with --isolatedModules #613

Closed
miroslavstastny opened this issue Dec 14, 2018 · 1 comment
Closed
Labels
vsts Paired with ticket in vsts
Projects

Comments

@miroslavstastny
Copy link
Member

miroslavstastny commented Dec 14, 2018

Bug Report

Steps

Create react app:

npx create-react-app stardust-consumer --typescript

Add stardust package, Provider, Button, run the app

Expected Result

Works

Actual Result

App fails to compile because of the two following errors 💣

  1. FocusZone (under our control):
/stardust-consumer/node_modules/@stardust-ui/react/dist/es/lib/accessibility/FocusZone/FocusZone.types.d.ts
Type error: Ambient const enums are not allowed when the '--isolatedModules' flag is provided.  TS1209

    114 |     preventDefaultWhenHandled?: boolean;
    115 | }
  > 116 | export declare const enum FocusZoneTabbableElements {
        |                           ^
    117 |     /** Tabbing is not allowed */
    118 |     none = 0,
    119 |     /** All tabbing action is allowed */
  1. Fela (out of our control, currently in all Fela version, up to 10.0.1):
stardust-consumer/node_modules/@stardust-ui/react/node_modules/fela/index.d.ts
Type error: Ambient const enums are not allowed when the '--isolatedModules' flag is provided.  TS1209

    11 |   type TEnhancer = (renderer: IRenderer) => IRenderer; //http://fela.js.org/docs/advanced/Enhancers.html
    12 | 
  > 13 |   const enum TSubscribeMessageType {
       |              ^
    14 |     rule = 'RULE',
    15 |     staticObject = 'RULE',
    16 |     keyframes = 'KEYFRAME',

Version

0.14.0

Why this is important

  • create-react-app is the essential way how to create the project
  • it is not possible to disable --isolatedModules there
@pkumarie2011 pkumarie2011 added the vsts Paired with ticket in vsts label Dec 14, 2018
@alinais alinais added this to miroslavstastny in Core Team Dec 19, 2018
@layershifter
Copy link
Member

We cannot build project with Babel because it also not working with const enum: https://babeljs.io/docs/en/babel-plugin-transform-typescript

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
vsts Paired with ticket in vsts
Projects
No open projects
Core Team
  
miroslavstastny
Development

No branches or pull requests

3 participants