嗨,如果有人愿意帮助我,我想在我的 nextjs 应用程序上使用 @Decorators,但出现以下错误。
希望有人知道我做错了什么
错误信息:
Syntax error: Support for the experimental syntax 'decorators-legacy' isn't currently enabled:
Run Code Online (Sandbox Code Playgroud)
我正在尝试使用 typeorm / type-graphql 在应用程序子文件夹中生成我的后端。
应用程序/预订/模型/booking.ts
Syntax error: Support for the experimental syntax 'decorators-legacy' isn't currently enabled:
Run Code Online (Sandbox Code Playgroud)
巴别尔
{
"presets": [
[
"next/babel",
{
"plugin-proposal-decorators": {"legacy": true}
}
]
],
}
Run Code Online (Sandbox Code Playgroud)
下一个.config.js
import {
Field,
ID,
ObjectType,
} from 'type-graphql';
import {
BaseEntity,
ManyToOne,
Column,
CreateDateColumn,
Entity,
PrimaryGeneratedColumn,
UpdateDateColumn,
VersionColumn,
} from 'typeorm';
import { ArrayNotEmpty, ArrayMinSize, IsPositive, Min, IsNotEmpty, ValidateNested, MaxLength, Length, …Run Code Online (Sandbox Code Playgroud)