6

चल रहा है मैं अपने कोणीय 2 ऐप के अनुवाद के लिए i18n निष्कर्षण उपकरण चलाने की कोशिश कर रहा हूं। लेकिन जब मैं चलाने का प्रयास मैं:कोणीय 2 "त्रुटि प्रतीकों को स्थिर रूप से हल करने में त्रुटि आई।" i18n

// Import the core angular services. 
import { ErrorHandler } from '@angular/core'; 
// import { forwardRef } from '@angular/core'; 
import { Inject } from '@angular/core'; 
import { Injectable } from '@angular/core'; 

// Import the application components and services. 
import { ErrorLogService } from './error-log.service'; 

export interface LoggingErrorHandlerOptions { 
    rethrowError: boolean; 
    unwrapError: boolean; 
} 

export var LOGGING_ERROR_HANDLER_OPTIONS: LoggingErrorHandlerOptions = { 
    rethrowError: false, 
    unwrapError: false 
}; 

@Injectable() 
export class LoggingErrorHandler implements ErrorHandler { 

    private errorLogService: ErrorLogService; 
    private options: LoggingErrorHandlerOptions; 

    constructor(
    errorLogService: ErrorLogService, 
    @Inject(LOGGING_ERROR_HANDLER_OPTIONS) options: LoggingErrorHandlerOptions <!--- ERROR 
) { 
    this.errorLogService = errorLogService; 
    this.options = options; 
    } 

त्रुटि हैंडलर इस लेख पर आधारित है::

Failed on type {"filePath":"C:/ng/anbud/src/app/_common/logging-error handler.ts","name":"LoggingErrorHandler"} with error Error: Error encountered resolving symbol values statically. Could 
not resolve type LoggingErrorHandlerOptions (position 34:53 in the original .ts file), resolving symbol LoggingErrorHandler in C:/ng/anbud/src/app/_common/logging-error-handler.ts 
Error: Error encountered resolving symbol values statically. Could not resolve type LoggingErrorHandlerOptions (position 34:53 in the original .ts file), resolving symbol LoggingErrorHandle 
r in C:/ng/anbud/src/app/_common/logging-error-handler.ts 
    at simplifyInContext (C:\ng\anbud\node_modules\@angular\compiler-cli\src\static_reflector.js:469:23) 
    at StaticReflector.simplify (C:\ng\anbud\node_modules\@angular\compiler-cli\src\static_reflector.js:472:22) 
    at StaticReflector.parameters (C:\ng\anbud\node_modules\@angular\compiler-cli\src\static_reflector.js:102:47) 
    at CompileMetadataResolver.getDependenciesMetadata (C:\ng\anbud\node_modules\@angular\compiler\bundles\compiler.umd.js:14317:56) 
    at CompileMetadataResolver.getTypeMetadata (C:\ng\anbud\node_modules\@angular\compiler\bundles\compiler.umd.js:14282:28) 
    at CompileMetadataResolver.getProviderMetadata (C:\ng\anbud\node_modules\@angular\compiler\bundles\compiler.umd.js:14473:42) 
    at C:\ng\anbud\node_modules\@angular\compiler\bundles\compiler.umd.js:14421:47 
    at Array.forEach (native) 
    at CompileMetadataResolver.getProvidersMetadata (C:\ng\anbud\node_modules\@angular\compiler\bundles\compiler.umd.js:14405:21) 
    at C:\ng\anbud\node_modules\@angular\compiler\bundles\compiler.umd.js:14412:43 
Extraction failed 

npm ERR! Windows_NT 10.0.10586 
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\js\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "i18n" 
npm ERR! node v6.5.0 
npm ERR! npm v3.10.8 
npm ERR! code ELIFECYCLE 
npm ERR! [email protected] i18n: `ng-xi18n` 
npm ERR! Exit status 1 

त्रुटि अपने कस्टम त्रुटि हैंडलर में है https://www.bennadel.com/blog/3138-creating-a-custom-errorhandler-in-angular-2-rc-6.htm

तो अगर आप कोड को पूरी तरह से देखना चाहते हैं, आप इसे वहां देख सकते हैं।

कोई भी जानता है कि यह त्रुटि क्यों फेंक दी गई है?

+0

एक ही समस्या। क्या आप कुछ ऐसा ही इस्तेमाल कर रहे हैं? यदि ऐसा है, तो इसे हटाने का प्रयास करें –

उत्तर

2

सिर्फ एक जंगली यहाँ अनुमान:

परिवर्तन

export interface LoggingErrorHandlerOptions 

का उपयोग करते समय मॉड्यूल NG2-अनुवाद मेरे लिए

को
export class LoggingErrorHandlerOptions 
संबंधित मुद्दे