Im writing a plugin, and as a part of the plugin i need to extend MoneyAmount repository. Whenever i run the build command i get an error saying
Exported variable 'MoneyAmountRepository' has or is using name '_QueryDeepPartialEntity' from external module "(path)/node_modules/typeorm/query-builder/QueryPartialEntity" but cannot be named
I've tried importing QueryDeepPartialEntity: import { QueryDeepPartialEntity } from "typeorm/query-builder/QueryPartialEntity"; but it didn't help.
I did not extend MoneyAmount model so i didn't include { target: MoneyAmount }. I've tried including it but the same error still occurred.
System information
Medusa version (including plugins): 1.20
Node.js version: 18.8.0
Database: Postgres
Operating system: Windows 10
Code snippets
import {
MoneyAmount,
ProductVariant,
ProductVariantMoneyAmount,
} from "@medusajs/medusa";
import { dataSource } from "@medusajs/medusa/dist/loaders/database";
import { MoneyAmountRepository as MedusaMoneyAmountRepository } from "@medusajs/medusa/dist/repositories/money-amount";
import { groupBy } from "lodash";
import { Brackets } from "typeorm";
export const MoneyAmountRepository = dataSource
.getRepository(MoneyAmount)
.extend(
Object.assign(MedusaMoneyAmountRepository, {
customFunction(): void {
console.log("test");
},
})
);
export default MoneyAmountRepository;
Describe the bug
Im writing a plugin, and as a part of the plugin i need to extend MoneyAmount repository. Whenever i run the build command i get an error saying
I've tried importing QueryDeepPartialEntity:
import { QueryDeepPartialEntity } from "typeorm/query-builder/QueryPartialEntity";
but it didn't help.I did not extend MoneyAmount model so i didn't include
{ target: MoneyAmount }
. I've tried including it but the same error still occurred.System information
Medusa version (including plugins): 1.20 Node.js version: 18.8.0 Database: Postgres Operating system: Windows 10
Code snippets