Skip to content

stackoverflow, OrmUtils.deepmerge js joda #6181

@xenoterracide

Description

@xenoterracide

Issue type:

[ ] question
[x ] bug report
[ ] feature request
[ ] documentation issue

Database system/driver:

[ ] cordova
[ ] mongodb
[ ] mssql
[ ] mysql / mariadb
[ ] oracle
[x] postgres
[ ] cockroachdb
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo

TypeORM version:

> node --version                                                                                        # service-graph -> feature/RS2-1044 !
v12.16.3
> yarn list typeorm                                                                                     # service-graph -> feature/RS2-1044 !
yarn list v1.22.4
warning Filtering by arguments is deprecated. Please use the pattern option instead.
└─ typeorm@0.2.25
✨  Done in 1.19s.
> yarn list typescript                                                                                  # service-graph -> feature/RS2-1044 !
yarn list v1.22.4
warning Filtering by arguments is deprecated. Please use the pattern option instead.
└─ typescript@3.7.4
✨  Done in 1.23s.

error


  ● DeviceRepository › findDeviceProductByDeviceIdWithStatusIn › all new

    RangeError: Maximum call stack size exceeded
        at Array.shift (<anonymous>)

      at Function.Object.<anonymous>.OrmUtils.mergeDeep (src/util/OrmUtils.ts:73:32)
      at Function.Object.<anonymous>.OrmUtils.mergeDeep (src/util/OrmUtils.ts:90:26)
      at Function.Object.<anonymous>.OrmUtils.mergeDeep (src/util/OrmUtils.ts:90:26)
      at Function.Object.<anonymous>.OrmUtils.mergeDeep (src/util/OrmUtils.ts:90:26)
      at Function.Object.<anonymous>.OrmUtils.mergeDeep (src/util/OrmUtils.ts:90:26)
      at Function.Object.<anonymous>.OrmUtils.mergeDeep (src/util/OrmUtils.ts:90:26)
      at Function.Object.<anonymous>.OrmUtils.mergeDeep (src/util/OrmUtils.ts:90:26)
      at Function.Object.<anonymous>.OrmUtils.mergeDeep (src/util/OrmUtils.ts:90:26)
      at Function.Object.<anonymous>.OrmUtils.mergeDeep (src/util/OrmUtils.ts:90:26)

firstly this error is terrible, at the very least it could tell me what field it's merging....

  @Column({
    name: 'date_joined',
    type: 'timestamp with time zone',
    transformer: zonedDateTimeTransformer(),
  })
  readonly dateJoined!: ZonedDateTime;

this is what I believe is causing the issue, ZonedDateTime comes from @js-joda/core

this is my transformer

export function zonedDateTimeTransformer(): ValueTransformer {
  return {
    from(value: string): ZonedDateTime {
      return ZonedDateTime.parse(value);
    },
    to(value: ZonedDateTime): string {
      return value.toString();
    },
  };
}```

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions