We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug Circular reference errors are thrown from TypeScript when using the Product entity in a local service class.
To Reproduce Steps to reproduce the behavior:
import { Injectable } from '@nestjs/common'; import { CreateProductInput, } from '@vendure/common/lib/generated-types'; import { ID } from '@vendure/common/lib/shared-types'; import { Product, ProductTranslation, RequestContext, } from '@vendure/core'; import { TranslatableSaver } from '@vendure/core/dist/service/helpers/translatable-saver/translatable-saver'; @Injectable() export class TestImporterService { constructor( private translatableSaver: TranslatableSaver, ) { } async createProduct(input: CreateProductInput): Promise<ID> { const product = await this.translatableSaver.create({ ctx: RequestContext.empty(), input, entityType: Product, translationType: ProductTranslation, beforeSave: async () => { // }, }); return product.id; } }
Expected behavior I do not expect these errors to happen.
Environment (please complete the following information):
Additional context See Slack's help channel for a discussion about this issue.
The text was updated successfully, but these errors were encountered:
Fwiw, the issue also happens in the Facet entity. In fact every entity that uses the Translation<T> type to reference itself has the issue. Think it all boils down to this line: https://github.com/vendure-ecommerce/vendure/blob/master/packages/core/src/common/types/locale-types.ts#L39
Translation<T>
When I remove the TranslatableKeys part from my local dist version everything works.
TranslatableKeys
Sorry, something went wrong.
a4243c4
michaelbromley
No branches or pull requests
Describe the bug
Circular reference errors are thrown from TypeScript when using the Product entity in a local service class.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I do not expect these errors to happen.
Environment (please complete the following information):
Additional context
See Slack's help channel for a discussion about this issue.
The text was updated successfully, but these errors were encountered: