Skip to content

Flow - doesnt support special char string type keys in object #878

Closed
@bradennapier

Description

@bradennapier
type SystemStatsEvent = {
  '@timestamp': number,
  '@projectIdentityID'?: string,
  '@systemIdentityID'?: string,
  '@userIdentityID'?: string,
  '@dealerIdentityID'?: string,
  hostname?: string,
  alarm?: boolean,
  cpu?: number,
  mem?: number
};

This is not allowed i get an error:

TypeError: Cannot read property 'charAt' of undefined
    at Of.inlineCode (/Users/bradennapier/.config/yarn/global/node_modules/remark-stringify/lib/visitors/inline-code.js:26:12)
    at Of.one [as visit] (/Users/bradennapier/.config/yarn/global/node_modules/remark-stringify/lib/macro/one.js:20:30)
    at Of.all (/Users/bradennapier/.config/yarn/global/node_modules/remark-stringify/lib/macro/all.js:14:27)
    at Of.paragraph (/Users/bradennapier/.config/yarn/global/node_modules/remark-stringify/lib/visitors/paragraph.js:6:15)
    at Of.one [as visit] (/Users/bradennapier/.config/yarn/global/node_modules/remark-stringify/lib/macro/one.js:20:30)
    at Of.listItem (/Users/bradennapier/.config/yarn/global/node_modules/remark-stringify/lib/visitors/list-item.js:41:26)
    at Of.unorderedItems [as visitUnorderedItems] (/Users/bradennapier/.config/yarn/global/node_modules/remark-stringify/lib/macro/unordered-items.js:18:24)
    at Of.list (/Users/bradennapier/.config/yarn/global/node_modules/remark-stringify/lib/visitors/list.js:12:41)
    at Of.one [as visit] (/Users/bradennapier/.config/yarn/global/node_modules/remark-stringify/lib/macro/one.js:20:30)
    at Of.block (/Users/bradennapier/.config/yarn/global/node_modules/remark-stringify/lib/macro/block.js:39:22)`

As far as I can tell the way I specified these keys with the special characters is the appropriate way to do this. Flow does parse it correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions