Tengo una clase de TypeScript que implementa una interfaz con las siguientes declaraciones. En la clase, importé el .js al comienzo del archivo de clase e implementé todas las funciones. Todo funcionó bien, hasta que agregué una nueva función en la interfaz e implementé la nueva función en la clase. Cuando se publica el proyecto, incluida la eliminación de todos los archivos en la carpeta de destino existente, en un host IIS, el navegador Edge no reconoce la función adicional. Volví a publicar el proyecto varias veces sin éxito. Al día siguiente, se reconoce la función. La nueva función siempre se reconoce inmediatamente en tiempo de compilación. ¿Alguien sabe por qué?
form.ts: 254 Uncaught TypeError: commonUtility.isTheSame is not a function at HTMLInputElement. < anonymous > (form.ts: 254: 25) at Function.each(jquery - 3.6 .0.min.js: 2: 3003) at S.fn.init.each(jquery - 3.6 .0.min.js: 2: 1481) at Object.submitTheForm(form.ts: 241: 18) at HTMLButtonElement. < anonymous > (form.ts: 86: 22) at HTMLButtonElement.dispatch(jquery - 3.6 .0.min.js: 2: 43064) at HTMLButtonElement.v.handle(jquery - 3.6 .0.min.js: 2: 41048) export interface ICommonUtility { isDate(aDate: Date): boolean; isEmpty($this: any): boolean; isTheSame($this: any, oldValue: string, currentValue: string): boolean; getCRUD($this: any, oldValue: string, currentValue: string): string; getControlValue($this: any): number; resetControlValue($this: any, newValue: string) getTextPixels(someText: string, font: any); breakLongSentence(thisSelectElement); } /// <reference path="../../node_modules/@types/jquery/jquery.d.ts" /> import { ICommonUtility } from "../appModels/ICommonUtility.js"; export class Utility implements ICommonUtility { isDate(aDate: Date): boolean { } isEmpty($this: any): boolean { } isTheSame($this: any, oldValue: string, currentValue: string): boolean { } getCRUD($this: any, oldValue: string, currentValue: string): string { } getControlValue($thisControl: any, valueSource: string = 'other'): any { } resetControlValue($thisControl: any, newValue: string) { } getTextPixels(someText: string, font: any) { } breakLongSentence(thisSelectElement: any) { } }Funcionó cuando isTheSame() se hizo público isTheSame() en la clase de utilidad de implementación. Todavía no sé por qué esto es necesario.