我在运行 flow check
时收到此错误,但我不确定这是什么意思。
Cannot use exports as a type because exports is a value. To get the type of a value use typeof.
错误位置是0:1(@flow注释处)。这是代码:
/* @flow */
import Chunk from '../models/Chunk'
export interface IChunkSorter {
sort(chunks: Chunk[]): Chunk[];
}
有什么想法吗?我用谷歌搜索了错误消息,但实际上没有任何结果。
最佳答案
问题出在一个完全不同的文件中,我错误地导入了 IChunkSorter
。我正在使用:
import type IChunkSorter from './IChunkSorter'
这修复了它:
import type { IChunkSorter } from './IChunkSorter'
关于javascript - 不能将 exports 用作类型,因为 exports 是一个值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49508444/