我收到流程错误:
Importing a type from an untyped module makes it
any
and is not safe! Did you mean to add// @flow
to the top of../types
? (untyped-type-import
)
这是“../types”文件中的一些代码。
// @flow
import type { Account } from '../../props/account'
import type { Accrual } from '../../props/accrual-prop'
import type { Amount } from '../../props/amount'
import type { Customer } from '../../props/customer'
import type { PaymentTerms } from '../../props/payment-terms'
import type { NumberSeries } from '../../props/number-series'
import type { SalesDocumentLock } from '../../props/lock-prop'
export type Status = 'invoice'|'order'|'offer'
export type CustomerContact = {
customerContactNumber: number,
name: string,
}
export type Employee = {
self?: ?string,
employeeNumber: number,
name: string,
}
export type AdditionalExpenseLine = {
additionalExpense: {
additionalExpenseNumber: number,
name: string,
isSystemCreated: boolean
},
vatAccount: VATAccount,
vatAmount?: ?number,
amount?: number,
grossAmount?:number,
isExcluded: boolean,
salesPricesEnteredInGross : boolean,
vatRate?:number,
additionalExpenseType: AdditionalExpenseType
}
最佳答案
我遇到了这样的问题,这似乎是由两个导出功能引起的,例如:export function foo() {}
并且还有一个module.exports = { ... }
在文件中也是如此。
一旦我摆脱了export function
声明问题消失了。 (我在文件中有许多 export type
语句,它们都很好。)
关于javascript - 如何使用 Flow 解决 Untyped 模块错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56722165/