Base solution for your next web application
Open Closed

Duplicate import in service-proxies. #10634


User avatar
0
ashjackson created

Prerequisites

  • What is your product version? 10.3
  • What is your product type (Angular or MVC)? Angular
  • What is product framework type (.net framework or .net core)? net50

Hi There, I have recently started getting the following issue when generating service proxies

    Error: src/shared/service-proxies/service-proxies.ts:10:10 - error TS2300: Duplicate identifier 'DateTime'.

    10 import { DateTime } from 'luxon';
                ~~~~~~~~
    src/shared/service-proxies/service-proxies.ts:16:10 - error TS2300: Duplicate identifier 'DateTime'.

    16 import { DateTime, Duration } from "luxon";
                ~~~~~~~~

When I examine the imports of the service proxies file I find that there are 2 luxon imports, with DateTime in both.

/* tslint:disable */
/* eslint-disable */
//----------------------
// <auto-generated>
//     Generated using the NSwag toolchain v13.13.2.0 (NJsonSchema v10.5.2.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org)
// </auto-generated>
//----------------------
// ReSharper disable InconsistentNaming

import { DateTime } from 'luxon';
import { mergeMap as _observableMergeMap, catchError as _observableCatch } from 'rxjs/operators';
import { Observable, throwError as _observableThrow, of as _observableOf } from 'rxjs';
import { Injectable, Inject, Optional, InjectionToken } from '@angular/core';
import { HttpClient, HttpHeaders, HttpResponse, HttpResponseBase } from '@angular/common/http';

import { DateTime, Duration } from "luxon";

When I manaully correct this, all is well, but if you could please shed any light on why this is happening I'd appreciate it!

Kind Regards, AJ.


2 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @ashjackson

    Could you check if your angular/nswag/service.extensions.ts file is empty or not ? If it contains luxon import, please remove it and generate the proxies again.

    Thanks,

  • User Avatar
    0
    ashjackson created

    Hi, Thankyou, this resolved my issue.

    AJ.