Skip to content
Discussion options

You must be logged in to vote

First of all ensure you have emitDecoratorMetadata set in tsconfig.json as per the docs:

 "compilerOptions": {
    ...    
    // needed for typeORM
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true
  },`

And include reflect-metadata in vite.config.js as you mentioned:

export default defineConfig({
  ...
  ssr: {
    external: ['reflect-metadata'],
  },
});

Despite all this effort with metadata reflection, there have been previous bugs with it, so ensure that every column in your entities has a labelled type:

@Entity({ name: 'test' })
export class Test extends BaseEntity {
  ...
  @Column({ type: 'varchar'})
  name!: string | null;
}

I personally have had some issues w…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@ngramp
Comment options

@saki82
Comment options

@Ennoriel
Comment options

@saki82
Comment options

@Ennoriel
Comment options

Answer selected by Ennoriel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants