Loopback encountered an issue due to the absence of metadata for the design-time type

Upon executing a controller with Loopback 4, I encounter a 500 error:

Unhandled error in GET /v1/me/societes: 500 Error: No design-time type metadata found while inspecting FirebaseAuthService.constructor[2]. You can either use `@service(ServiceClass)` or ensure `emitDecoratorMetadata` is enabled in your TypeScript configuration. Run `tsc --showConfig` to print the final TypeScript configuration of your project.

I suspect that the issue lies in the injection of FirebaseService here :

@injectable({scope: BindingScope.SINGLETON})
export class FirebaseAuthService {
  constructor(
    @repository(UtilisateurRepository)
    public utilisateurRepository: UtilisateurRepository,
    @repository(TokenRepository)
    public tokenRepository: TokenRepository,
    @service(FirebaseService)
    public firebaseService: FirebaseService,
  ) {}

However, the FirebaseService class appears to be properly defined:

@injectable({scope: BindingScope.SINGLETON})
export class FirebaseService {

All my service classes reside in the src/services directory, which should be registered by Loopback. Could it be possible that my issue is unrelated to service injections?

I have been grappling with this for hours. Does anyone have any insights?

Thank you for your assistance!

Olivier

Answer №1

Having encountered a similar issue myself, the solution lies in importing the complete file path rather than just the folder. For example, you should import ServiceA from './services/service-a.service';

Answer №2

By eliminating the circular dependency in service injections, I was able to successfully resolve this problem.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Forming a distinct array from a collection of objects

Describing demoList: demoList = [ { id: 1, validFrom: "2019-06-01T00:00:00", validTo: "2020-06-17T00:00:00", xxxM: 50, xxxN: 2.2, xxxQ45: 2, xxxQ100: 1.65, xxxQ125: null, xxxQ150: null, xxxQ2 ...

An object that appears to be empty at first glance, but contains values that are undefined

I am facing an issue with my object that I am populating with information. The logs show the object as empty, but when I inspect it in Chrome, it appears to have the correct details filled in. Here is a snapshot of what the logs display: closed: closed o ...

Enhancing data binding in Angular 2.0 with string interpolation

In my script, I am working with a string that goes like this: {name} is my name. Greeting {sender} Is there a module available in Angular 2.0 that allows me to use something similar to the string.format() function in C#? I understand that it can be achie ...

I'm encountering issues with the Cordova social share plugins not functioning properly within my Angular2 application

Having trouble navigating the ins and outs of using social share plugins. SocialSharing-PhoneGap-Plugin Every time I attempt to call on this plugin, an undefined error pops up. Here is a snippet of my code. window.plugins.socialsharing.share("test"); Aft ...

Upon transitioning from Angular 5 to Angular 6, a noticeable issue arises: The existing document lacks a required doctype

I recently updated my project from Angular 5 to Angular 6. Post-upgrade, everything compiles without errors. However, when I try to access the website, all I see is a blank screen. Upon inspecting the console, I came across the following error message: Th ...

Error encountered: The import of 'createLocation' from 'history' failed. This issue occurred due to conflicting versions of History and React-Router-DOM

While attempting to configure an existing project on a new development server, I encountered the following error: ./node_modules/react-router-dom/esm/react-router-dom.js Attempted import error: 'createLocation' is not exported from 'histor ...

Unlocking the Power of PropTypes.shape in TypeScript

Currently, I am in the process of migrating a React application from Javascript to Typescript. However, I am encountering difficulties, particularly with migrating the shape PropType. The code I have right now looks like this: import React from 'reac ...

"Exploring TypeScript's capabilities: Unraveling the depths of nested JSON

Encountering a TypeScript error with the code block below: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ id: string; path: string; basename: string; createdOn: s ...

The border of the Material UI Toggle Button is not appearing

There seems to be an issue with the left border not appearing in the toggle bar below that I created using MuiToggleButton. Any idea what could be causing this? Thank you in advance. view image here view image here Just a note: it works correctly in the ...

Resetting a Subject entity

Is there a way to reset an Observable object? I'm not sure if "reinitialize" is the right term, but essentially what I want is to update the data without creating a new Observable object or new subscriptions. I want existing subscriptions to seamless ...

The parameter `Matcher` does not accept the argument type `content: string, node: Element | null, returning boolean | null | undefined`

I encountered an issue with my React Typescript app while unit testing, where I had to use the following code to locate an element based on its textContent: import { screen } from "@testing-library/react"; export function getByTextContent(textMa ...

Encountering issues with integrating interactjs 1.7.2 into Angular 8 renderings

Currently facing challenges with importing interactive.js 1.7.2 in Angular 8. I attempted the following installation: npm install interactjs@next I tried various ways to import it, but none seemed to work: import * as interact from 'interactjs'; ...

Generating dynamic rows and columns with Angular and Bootstrap in real time

I am looking to dynamically generate rows in an angular template, with each row containing 4 columns. For example, if the input is 40, the output should have 10 rows, each consisting of 4 columns. I am using bootstrap for my template layout. Below is what ...

What is the process for validating a certificate chain in Flutter?

In my Flutter mobile app, I need to verify the integrity of certificate chains stored within the app. Other mobile clients will be sending certificates to this device for validation against the intermediate cert. While I've successfully implemented a ...

Leverage JavaScript libraries utilizing namespaces within your Angular application

I have a unique JavaScript library that includes functions organized within namespaces. For example: var testNamespace = { insideFunction: function(str) { alert(atr); } }; Now, I am trying to integrate these functions into my Angular app.c ...

What causes the "This expression is not callable..." errors to occur in TypeScript and React JS?

As a newcomer to typescript, I am unsure why I am encountering this error while working with my data list array: const { data: CUData = { cu: [] as Array<CuType> }, } = useGetCUQuery(); let CUDataArray = CUData && CUData.cu ? CUDat ...

Upon the initial loading of GoJS and Angular Links, nodes are not bypassed

Hey there, I'm currently working on a workflow editor and renderer using Angular and GoJS. Everything seems to be in order, except for this one pesky bug that's bothering me. When the page first loads, the links don't avoid nodes properly. H ...

Encountering numerous TypeScript errors following the execution of an Ionic project on MacOs

My Ionic app works perfectly on Windows, but I am encountering issues when trying to run it on MacOs El Capitan through VirtualBox. Despite setting everything up correctly on my MacOs, I am facing numerous typescript errors when running the app using Ionic ...

Tips for handling interfaces that are of an unusually large size?

Imagine having an interface like the one below with 10 or more properties: export interface EmployeeFilter { name: string; gender: string; age: number; from: Date; to: Date; module: string; position: string; phone: string; email: string; ...

Error: The 'name' property is not found in the 'EventTarget' type - React with TypeScript

This code snippet showcases my current setup: <Button disabled={filter === 'Active'} size='md' color='primary' name='Active' // complete = false onClick={this.handleFilterClick} > Active </Button ...