TypeORM ColumnTypeUndefined错误排除步骤出错?

时间:2019-03-28 21:50:55

标签: typescript webpack typeorm

将TypeORM添加到原始Javascript项目中,但出现此错误。该项目与webpack打包在一起,由弹出的create-react-app构建。

ColumnTypeUndefinedError: Column type for Commodity#name is not defined and
cannot be guessed. Make sure you have turned on an "emitDecoratorMetadata": true
option in tsconfig.json. Also make sure you have imported "reflect-metadata on
top of the main entry file in your application (before any entity imported). If
you are using JavaScript instead of TypeScript you must explicitly provide a
column type.

按照说明进行操作。看到反映在全球范围内。仍然出现错误。从这里建议采取什么步骤?

1 个答案:

答案 0 :(得分:0)

@Column() 必须设置一个类型,比如@Column('text',{nullable:true}).

更多信息请访问 https://github.com/typeorm/typeorm/issues/2897