Hello I have an Angular 2 Project using fullcalendar. I have a problem when I'm trying to deploy it to heroku and I get a build error like this.
remote: ERROR in node_modules/fullcalendar/dist/fullcalendar.d.ts(695,36): error TS2304: Cannot find name 'JQueryPromise'.
remote: node_modules/fullcalendar/dist/fullcalendar.d.ts(696,29): error TS2304: Cannot find name 'JQueryPromise'.
remote: node_modules/fullcalendar/dist/fullcalendar.d.ts(697,20): error TS2304: Cannot find name 'JQueryPromise'.
remote: node_modules/fullcalendar/dist/fullcalendar.d.ts(759,22): error TS2304: Cannot find name 'JQueryPromise'.
remote: node_modules/fullcalendar/dist/fullcalendar.d.ts(775,50): error TS2304: Cannot find name 'JQueryPromise'.
remote: node_modules/fullcalendar/dist/fullcalendar.d.ts(988,23): error TS2304: Cannot find name 'JQueryEventObject'.
remote: node_modules/fullcalendar/dist/fullcalendar.d.ts(1401,70): error TS2304: Cannot find name 'JQueryAjaxSettings'.
remote: node_modules/fullcalendar/dist/fullcalendar.d.ts(1603,50): error TS2304: Cannot find name 'JQueryPromise'.
remote: node_modules/fullcalendar/dist/fullcalendar.d.ts(1623,50): error TS2304: Cannot find name 'JQueryPromise'.
remote: node_modules/fullcalendar/dist/fullcalendar.d.ts(2588,50): error TS2304: Cannot find name 'JQueryPromise'.
remote: node_modules/ng-fullcalendar/src/calendar.component.d.ts(3,10): error TS2305: Module ''fullcalendar'' has no exported member 'Options'.
remote: src/app/components/view-calendar/view-calendar.component.ts(3,10): error TS2305: Module ''fullcalendar'' has no exported member 'Options'.
I stumbled upon on how to resolve the issue by installing the following
npm install --save-dev @types/jquery@3.2.7
But I still get the error when pushing and deploying the code to heroku.
EDIT
Here are the dependencies under my package.json
"dependencies": {
"@angular/animations": "^5.2.3",
"@angular/cdk": "^5.2.0",
"@angular/cli": "1.6.5",
"@angular/common": "^5.2.0",
"@angular/compiler": "^5.2.0",
"@angular/compiler-cli": "^5.2.0",
"@angular/core": "^5.2.0",
"@angular/forms": "^5.2.0",
"@angular/http": "^5.2.0",
"@angular/material": "^5.2.0",
"@angular/platform-browser": "^5.2.0",
"@angular/platform-browser-dynamic": "^5.2.0",
"@angular/router": "^5.2.0",
"@ng-bootstrap/ng-bootstrap": "^1.0.0",
"@types/jquery": "^3.2.7",
"angular-calendar": "^0.23.6",
"angular-material": "^1.1.6",
"axios": "^0.17.1",
"bootstrap": "4.0.0-beta.2",
"core-js": "^2.4.1",
"font-awesome": "^4.7.0",
"fullcalendar": "^3.6.1",
"jquery": "^3.3.1",
"jsonwebtoken": "^8.1.1",
"moment": "^2.20.1",
"ng-file-upload": "^12.2.13",
"ng-fullcalendar": "^1.4.6",
"ng-modal": "^1.0.2",
"ng-sidebar": "^6.0.5",
"ng2-opd-popup": "^1.1.21",
"ngx-bootstrap": "^2.0.2",
"popper.js": "^1.12.9",
"rxjs": "^5.5.6",
"underscore": "^1.8.3",
"zone.js": "^0.8.19"
},
答案 0 :(得分:0)
在部署到Heroku之前使用<?php
if (is_array($info[0])) {
foreach ($info as $fields) {
// Do something...
}
} else {
// Do something else...
}
(而不是npm install --save @types/jquery@3.2.7
),或者将“dev”版本部署到Heroku。