You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Hello, I ran into this problem I hope this fix can be implemented or the solution helps with the migration by hand
Flow file:
export const MyEnum = {
birthday: "birthday",
zip: "zip",
};
export type MyType = {|
// ...
userErrors: {
[type: $Keys<typeof MyEnum>]: string, // <--- this makes it fail
},
|};
TS file:
//...
userErrors: {
[key in keyof typeof MyEnum]: string; // <--- My manual translation to TS
};
Error thrown:
TypeError: Property name expected type of string but got null
at Object.validate (MY_PROJECT/node_modules/@khanacademy/flow-to-ts/node_modules/@babel/types/lib/definitions/utils.js:160:13)
at validateField (MY_PROJECT/node_modules/@khanacademy/flow-to-ts/node_modules/@babel/types/lib/validators/validate.js:24:9)
at validate (MY_PROJECT/node_modules/@khanacademy/flow-to-ts/node_modules/@babel/types/lib/validators/validate.js:17:3)
at builder (MY_PROJECT/node_modules/@khanacademy/flow-to-ts/node_modules/@babel/types/lib/builders/builder.js:38:27)
at Object.TSTypeParameter (MY_PROJECT/node_modules/@khanacademy/flow-to-ts/node_modules/@babel/types/lib/builders/generated/index.js:1202:31)
at MY_PROJECT/node_modules/@khanacademy/flow-to-ts/src/transform.js:568:35
at Array.forEach (<anonymous>)
at Object.exit (MY_PROJECT/node_modules/@khanacademy/flow-to-ts/src/transform.js:558:16)
at NodePath._call (MY_PROJECT/node_modules/@khanacademy/flow-to-ts/babel-traverse/lib/path/context.js:55:20)
at NodePath.call (MY_PROJECT/node_modules/@khanacademy/flow-to-ts/babel-traverse/lib/path/context.js:42:17)
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello, I ran into this problem I hope this fix can be implemented or the solution helps with the migration by hand
Flow file:
TS file:
Error thrown:
The text was updated successfully, but these errors were encountered: