IMPORTANT!
This forum is now archived. Click here for the New Support Forum
Visual Studio 2017 displays errors even though the code is correct
Quote from Ingo on April 3, 2018, 1:23 pmHi,
I use the pro QuickApp Pro.
I get follow error message:
Severity Code Description Project file line suppression state
Error TS2304 (TS) The name "require" was not found. QuickApp.Pro C:\Users\Ingo\Source\repos\TipWeb\QuickApp.Pro\ClientApp\src\app\Services\app-active translation.service.ts 109case "en": return Observable.of(require("../assets/locale/en.json"));This is the original code
or
Severity Code Description Project file line suppression state
Error TS2322 (TS) The type "Observable <{} | T>" can not be assigned to the type "Observable <T>".
The type "{} | T" can not be assigned to the type "T".
The type "{}" can not be assigned to the type "T". QuickApp.Pro C:\Users\Ingo\Source\repos\TipWeb\QuickApp.Pro\ClientApp\src\app\tip-services\bank active endpoint.service.ts 30getBanksEndpoint<T>(page?: number, pageSize?: number): Observable<T> { let endpointUrl = page && pageSize ? `${this._banksUrl}/${page}/${pageSize}` : this._banksUrl; return this.http.get<T>(endpointUrl, this.getRequestHeaders()) .catch(error => { return this.handleError(error, () => this.getBanksEndpoint(page, pageSize)); }); }This code are ok. What can I do??
regards Ingo
Hi,
I use the pro QuickApp Pro.
I get follow error message:
Severity Code Description Project file line suppression state
Error TS2304 (TS) The name "require" was not found. QuickApp.Pro C:\Users\Ingo\Source\repos\TipWeb\QuickApp.Pro\ClientApp\src\app\Services\app-active translation.service.ts 109
case "en": return Observable.of(require("../assets/locale/en.json"));
This is the original code
or
Severity Code Description Project file line suppression state
Error TS2322 (TS) The type "Observable <{} | T>" can not be assigned to the type "Observable <T>".
The type "{} | T" can not be assigned to the type "T".
The type "{}" can not be assigned to the type "T". QuickApp.Pro C:\Users\Ingo\Source\repos\TipWeb\QuickApp.Pro\ClientApp\src\app\tip-services\bank active endpoint.service.ts 30
getBanksEndpoint<T>(page?: number, pageSize?: number): Observable<T> { let endpointUrl = page && pageSize ? `${this._banksUrl}/${page}/${pageSize}` : this._banksUrl; return this.http.get<T>(endpointUrl, this.getRequestHeaders()) .catch(error => { return this.handleError(error, () => this.getBanksEndpoint(page, pageSize)); }); }
This code are ok. What can I do??
regards Ingo
Quote from Al Ve on April 5, 2018, 11:11 amIf your import statements are there and you didn't change the package.json then I would suggest to remove the node_modules folder and make an npm install again.
rm -rf node_modules/
npm cache clean
npm install
If your import statements are there and you didn't change the package.json then I would suggest to remove the node_modules folder and make an npm install again.
rm -rf node_modules/
npm cache clean
npm install
IMPORTANT!
This forum is now archived. Click here for the New Support Forum