-
Notifications
You must be signed in to change notification settings - Fork 86
Description
Hello,
switching Typescript transpilation to jiti
in Nuxt 2.15.0 has caused some problems with our code base that have prevented us from upgrading:
We are using class-validator
to validate data and define our classes like this:
export class SomeModel {
@IsString()
@IsDefined()
public readonly someField!: string;
}
This causes an Error: TRANSFORM_ERROR: Definitely assigned fields cannot be initialized here, but only in the constructor
on Nuxt startup which can be fixed by adding @babel/plugin-proposal-class-properties
to the transformation. Somehow, @babel/plugin-syntax-class-properties
is already included.
In addition, we are using Nest for our serverMiddleware
and have some way to utilize it's dependency injection during server side rendering. Since the dependency injection relies on emitDecoratorMetadata
we'd need babel-plugin-transform-typescript-metadata
to be added to the transformation.