formio / angular

JSON powered forms for Angular
https://formio.github.io/angular-demo
MIT License
615 stars 462 forks source link

Deployment errors while building | core-js compatibility error #308

Closed mudasserzahid closed 4 years ago

mudasserzahid commented 4 years ago

Hi here is what I am doing, I am deploying the angular application using deploybot here I have used 2.7.2 typescript here is my package.json

{
  "name": "apex",
  "version": "4.1.0",
  "license": "",
  "scripts": {
    "start-server": "node server.js",
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "master-build": "ng build --prod --named-chunks",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@agm/core": "^1.0.0-beta.5",
    "@agm/js-marker-clusterer": "^1.0.0-beta.5",
    "@angular/animations": "^6.1.10",
    "@angular/common": "^6.1.10",
    "@angular/compiler": "^6.1.10",
    "@angular/core": "^6.1.10",
    "@angular/forms": "^6.1.10",
    "@angular/http": "^6.1.10",
    "@angular/platform-browser": "^6.1.10",
    "@angular/platform-browser-dynamic": "^6.1.10",
    "@angular/platform-server": "^6.1.10",
    "@angular/router": "^6.1.10",
    "@ng-bootstrap/ng-bootstrap": "^1.0.4",
    "@ngrx/store": "^5.2.0",
    "@ngx-share/core": "^6.0.1",
    "@ngx-translate/core": "^9.0.2",
    "@ngx-translate/http-loader": "^2.0.1",
    "@qontu/ngx-inline-editor": "^0.2.0-alpha.12",
    "@swimlane/ngx-charts": "^7.1.0",
    "@types/chartist": "^0.9.44",
    "@types/d3-shape": "^1.3.1",
    "agm-direction": "^0.5.9",
    "angular-calendar": "^0.23.7",
    "angular-formio": "^3.16.2",
    "angular-wizard-form": "^0.4.1",
    "angular2-signaturepad": "^2.8.0",
    "angular2-wizard": "^0.4.0",
    "angularfire2": "^5.1.3",
    "bootstrap": "^4.3.1",
    "bootstrap-material-design": "^4.1.1",
    "bourbon": "^4.3.4",
    "chartist": "^0.11.0",
    "classlist.js": "^1.1.20150312",
    "core-js": "^2.6.9",
    "d3": "^4.13.0",
    "firebase": "^5.11.1",
    "intl": "^1.2.5",
    "jquery": "^3.4.1",
    "js-marker-clusterer": "^1.0.0",
    "jspdf": "^1.5.3",
    "moment": "^2.24.0",
    "ng-chartist": "^1.1.1",
    "ng-lazyload-image": "^5.1.2",
    "ng-socket-io": "^0.2.4",
    "ng2-charts": "^1.6.0",
    "ng2-ckeditor": "1.2.2",
    "ng2-file-upload": "^1.3.0",
    "ng2-nouislider": "^1.8.2",
    "ng2-select2": "^1.0.0-beta.16",
    "ng2-validation": "^4.2.0",
    "ngx-chips": "^1.9.8",
    "ngx-color-picker": "^5.3.8",
    "ngx-text-overflow-clamp": "0.0.1",
    "ngx-toastr": "^9.2.0",
    "ngx-ui-switch": "^1.6.0",
    "node-sass": "^4.10.0",
    "nouislider": "^11.0.3",
    "ramda": "0.25.0",
    "resize-observer-polyfill": "^1.5.1",
    "rxjs": "6.0.0",
    "rxjs-compat": "6.2.2",
    "screenfull": "^3.3.3",
    "select2": "4.0.6-rc.1",
    "slick-carousel": "^1.8.1",
    "sweetalert2": "^7.33.1",
    "web-animations-js": "^2.2.5",
    "zone.js": "^0.8.29"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.11.4",
    "@angular/cli": "^6.2.9",
    "@angular/compiler-cli": "^6.1.10",
    "@angular/language-service": "^6.1.10",
    "@types/core-js": "^0.9.43",
    "@types/jasmine": "^2.8.16",
    "@types/jquery": "^3.3.29",
    "@types/jspdf": "^1.3.0",
    "@types/node": "^9.6.48",
    "@types/slick-carousel": "^1.6.33",
    "agm-overlays": "^1.3.3",
    "codelyzer": "^4.5.0",
    "jasmine-core": "^2.99.1",
    "jasmine-spec-reporter": "^4.2.1",
    "karma": "^3.1.4",
    "karma-chrome-launcher": "^2.2.0",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.4.3",
    "karma-jasmine": "^1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "^5.4.2",
    "ts-node": "^4.1.0",
    "tslint": "^5.16.0",
    "typescript": "2.7.2"
  }
}

I am getting this error which is confusing to me,

ERROR in ./node_modules/formiojs/WebformBuilder.js
output Module not found: Error: Can't resolve 'core-js/modules/es.array.concat' in '/source/node_modules/formiojs'
output ERROR in ./node_modules/formiojs/Component.js
output Module not found: Error: Can't resolve 'core-js/modules/es.array.concat' in '/source/node_modules/formiojs'
output ERROR in ./node_modules/formiojs/Wizard.js
output Module not found: Error: Can't resolve 'core-js/modules/es.array.concat' in '/source/node_modules/formiojs'
output ERROR in ./node_modules/formiojs/EventEmitter.js
output Module not found: Error: Can't resolve 'core-js/modules/es.array.concat' in '/source/node_modules/formiojs'
output ERROR in ./node_modules/formiojs/Webform.js
output Module not found: Error: Can't resolve 'core-js/modules/es.array.concat' in '/source/node_modules/formiojs'
output ERROR in ./node_modules/formiojs/Form.js
output Module not found: Error: Can't resolve 'core-js/modules/es.array.concat' in '/source/node_modules/formiojs'
output ERROR in ./node_modules/formiojs/Formio.js
output Module not found: Error: Can't resolve 'core-js/modules/es.array.concat' in '/source/node_modules/formiojs'
output ERROR in ./node_modules/formiojs/components/address/Address.form.js

I have tried dowgrading the version of formio but still it is throwing same error.. Please help.

saajidsyed commented 4 years ago

@mudasserzahid update
"angular-formio": "3.17.0" Add "formiojs":"3.21.5" in you package.json file it will resolve the issue

mudasserzahid commented 4 years ago

@saajidsyed this fixed the previously mentioned issue but now I am gettings issue on polyyfills.ts like

./node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/jit-polyfills.js
Module not found: Error: Can't resolve 'core-js/es7/reflect' in 'E:\xampp\htdocs\vpanel\node_modules\@angular-devkit\build-angular\src\angular-cli-files\models'
travist commented 4 years ago

The issue is with an upgrade of core-js versions in formiojs. We can possibly fix this by making core-js a dependency in this library. I will make a new version that I hope resolves the problem.

travist commented 4 years ago

Please try version 3.19.0 and let me know if it resolves this problem.

mudasserzahid commented 4 years ago

No, it didn't help me in fixing the issue that I am facing.

saajidsyed commented 4 years ago

polyfills

Have you tried by clearing node modules and reinstall it? If not please delete node modules folder and reinstall. it may resolve your problem inshallah.

mudasserzahid commented 4 years ago

@saajidsyed Yes I have tried that thing fr each time, but it is still not working

saajidsyed commented 4 years ago

@mudasserzahid Can you try by adding "core-js": 2.6.9 to your package file and reinstall node modules. it will solve your problem inshallah.

mudasserzahid commented 4 years ago

@saajidsyed , bro if you see in my first question. I used also "core-js": "2.6.9" and "core-js": "62.6.9" version.

travist commented 4 years ago

@mudasserzahid If you do have "core-js": "2.6.9" in your application, when you type npm install you should see the following structure added to your "node_modules" folder.

If you do not see this, then this tells me that NPM is confused. Please upgrade your NPM and then try to install again.

saajidsyed commented 4 years ago

@saajidsyed , bro if you see in my first question. I used also "core-js": "2.6.9" and "core-js": "62.6.9" version.

Remove cap before the version number and try to install @mudasserzahid