Surprising circularity error in 3.9 RC · Issue #38279 · microsoft/TypeScript (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

@amcasey

Description

@amcasey

I haven't had a chance to reduce the repro, but people seem eager to get started. I'll try to update with better steps. For now:

  1. git clone --depth=1 https://github.com/davidkpiano/xstate
  2. yarn install --ignore-scripts
  3. tsc -b -f packages/xstate-vue
  4. Fix packages/core/src/actions.ts:108:9 - error TS2783: 'type' is specified more than once, so this usage will be overwritten.
  5. tsc -b -f packages/xstate-vue

Expected: no errors, as in 3.8.3
Actual:

packages/xstate-vue/src/xstate-machine.ts:16:14 - error TS2615: Type of property 'machine' circularly references itself in mapped type 'RecordPropsDefinition<{ machine: any; options: any; }>'.

 16     machine: {
                 ~
 17       type: Object,
    ~~~~~~~~~~~~~~~~~~~
... 
 19       default: () => ({})
    ~~~~~~~~~~~~~~~~~~~~~~~~~
 20     },
    ~~~~~

packages/xstate-vue/src/xstate-machine.ts:23:23 - error TS2615: Type of property 'options' circularly references itself in mapped type 'RecordPropsDefinition<{ machine: any; options: any; }>'.

23       default: () => ({})
                         ~~

TypeScript Version: 3.9.1-rc