Skip to content
This repository was archived by the owner on Sep 9, 2024. It is now read-only.
This repository was archived by the owner on Sep 9, 2024. It is now read-only.

ERROR in getInternalNameOfClass() called on a non-ES5 class: expected ShareService to have an inner class declaration #126

@Prasanth-FrontEnd

Description

@Prasanth-FrontEnd

I have upgraded the project from angular version 8 to 9. I had faced a lot of errors and type-checking issues. So I searched for the solution, everyone suggested to disable the Ivy compiler.

So I have disabled the Ivy compiler by changing:

"options": {
"aot": false
}

But while deploying into the production server I'm getting this error.

ERROR in getInternalNameOfClass() called on a non-ES5 class: expected ShareService to have an inner class declaration

Please get back to me ASAP. My client was very frustrated about this issue. I had put a lot of time to upgrade angular, angular material and other required libraries. Everything was working fine but only deploying I'm getting this error.

package.json:

"dependencies": {
"@agm/core": "1.1.0",
"@angular/animations": "^9.1.13",
"@angular/cdk": "^9.2.4",
"@angular/common": "^9.1.13",
"@angular/compiler": "^9.1.13",
"@angular/core": "^9.1.13",
"@angular/forms": "^9.1.13",
"@angular/localize": "9.1.13",
"@angular/material": "^9.2.4",
"@angular/platform-browser": "^9.1.13",
"@angular/platform-browser-dynamic": "^9.1.13",
"@angular/platform-server": "^9.1.13",
"@angular/router": "^9.1.13",
"@fortawesome/angular-fontawesome": "^0.3.0",
"@fortawesome/fontawesome-svg-core": "^1.2.35",
"@fortawesome/free-brands-svg-icons": "^5.15.3",
"@fortawesome/free-solid-svg-icons": "^5.15.3",
"@ng-bootstrap/ng-bootstrap": "4.0.4",
"@ngtools/webpack": "8.3.25",
"@nguniversal/express-engine": "^7.1.0",
"@ngx-formly/bootstrap": "5.4.3",
"@ngx-formly/core": "5.4.3",
"@ngx-share/button": "^7.1.2",
"@ngx-share/buttons": "^7.1.2",
"@ngx-share/core": "^7.1.2",
"@ngx-translate/core": "^11.0.1",
"@ngx-translate/http-loader": "^4.0.0",
"@stripe/stripe-js": "^1.14.0",
"@types/google.analytics": "^0.0.39",
"@types/quill": "^2.0.6",
"bootstrap": "4.6.0",
"core-js": "2.6.5",
"elastic-builder": "^2.13.0",
"font-awesome": "4.7.0",
"hammerjs": "^2.0.8",
"jquery": "3.3.1",
"moment": "2.24.0",
"ng-intercom": "^8.0.2",
"ng-jhipster": "^0.9.3",
"ng-recaptcha": "4.3.0",
"ng2-nouislider": "^1.8.3",
"ngx-cookie": "^4.1.2",
"ngx-infinite-scroll": "7.2.0",
"ngx-quill": "9.2.0",
"ngx-sharebuttons": "^8.0.5",
"ngx-webstorage": "4.0.2",
"node-sass": "4.12.0",
"nouislider": "10.1.0",
"primeicons": "2.0.0",
"primeng": "^9.1.3",
"quill": "^1.3.7",
"quill-emoji": "^0.2.0",
"quill-mention": "^3.0.3",
"ramda": "^0.26.1",
"reflect-metadata": "0.1.13",
"rxjs": "^6.6.7",
"sockjs-client": "1.3.0",
"swagger-ui": "2.2.10",
"tether": "1.4.5",
"tslib": "^1.10.0",
"uppy": "0.30.5",
"uuid": "3.4.0",
"webstomp-client": "1.2.6",
"workbox-webpack-plugin": "3.6.3",
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.901.15",
"@angular/cli": "^9.1.15",
"@angular/compiler-cli": "9.1.13",
"@types/jasmine": "3.3.9",
"@types/node": "^12.11.1",
"angular-router-loader": "0.8.5",
"angular2-template-loader": "0.6.2",
"awesome-typescript-loader": "5.2.1",
"browser-sync": "2.26.3",
"browser-sync-webpack-plugin": "2.2.2",
"cache-loader": "2.0.1",
"codelyzer": "^5.1.2",
"copy-webpack-plugin": "5.0.0",
"css-loader": "2.1.0",
"exports-loader": "0.7.0",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"file-loader": "3.0.1",
"fork-ts-checker-webpack-plugin": "0.5.2",
"friendly-errors-webpack-plugin": "1.7.0",
"generator-jhipster": "5.8.1",
"html-loader": "0.5.5",
"html-webpack-plugin": "3.2.0",
"jasmine-core": "3.3.0",
"karma": "4.0.0",
"karma-chrome-launcher": "2.2.0",
"karma-coverage": "1.1.2",
"karma-intl-shim": "1.0.3",
"karma-jasmine": "2.0.1",
"karma-junit-reporter": "1.2.0",
"karma-notify-reporter": "1.1.0",
"karma-phantomjs-launcher": "1.0.4",
"karma-remap-istanbul": "0.6.0",
"karma-sourcemap-loader": "0.3.7",
"karma-webpack": "3.0.5",
"lint-staged": "8.1.4",
"lodash": "4.17.11",
"merge-jsons-webpack-plugin": "1.0.18",
"mini-css-extract-plugin": "^0.5.0",
"moment": "2.24.0",
"moment-locales-webpack-plugin": "1.0.7",
"ngc-webpack": "^4.1.2",
"ngx-stripe": "9.0.3",
"phantomjs-prebuilt": "2.1.16",
"postcss-loader": "3.0.0",
"prettier": "1.16.4",
"proxy-middleware": "0.15.0",
"puppeteer": "1.12.2",
"rimraf": "2.6.3",
"sass-loader": "7.1.0",
"simple-progress-webpack-plugin": "1.1.2",
"source-map": "0.7.3",
"sourcemap-istanbul-instrumenter-loader": "0.2.0",
"string-replace-webpack-plugin": "0.1.3",
"style-loader": "0.23.1",
"thread-loader": "2.1.2",
"to-string-loader": "1.1.5",
"ts-loader": "5.3.3",
"ts-node": "8.0.2",
"tslint": "5.12.1",
"tslint-config-prettier": "1.18.0",
"tslint-loader": "3.6.0",
"typescript": "3.8.3",
"uglifyjs-webpack-plugin": "2.1.1",
"web-app-manifest-loader": "0.1.1",
"webpack": "4.29.5",
"webpack-cli": "3.2.3",
"webpack-dev-server": "3.2.0",
"webpack-merge": "4.2.1",
"webpack-notifier": "1.7.0",
"webpack-visualizer-plugin": "0.1.11",
"write-file-webpack-plugin": "4.5.0",
"xml2js": "0.4.19"
},
"lint-staged": {
"src//*.{ts,css,scss}": [
"prettier --write",
"git add"
]
},
"engines": {
"node": ">=8.9.0"
},
"scripts": {
"prettier:format": "yarn prettier --write 'src/
/*.{ts,css,scss}'",
"lint": "tslint --type-check --project tsconfig.json -e 'node_modules/**'",
"lint:fix": "yarn run lint --fix",
"ngc": "ngc -p tsconfig-aot.json",
"cleanup": "rimraf target/{aot,www}",
"clean-www": "rimraf target//www/app/{src,target/}",
"start": "yarn run webpack:dev",
"serve": "yarn run start",
"build": "yarn run webpack:prod",
"qa": "yarn run webpack:qa",
"test": "karma start src/test/javascript/karma.conf.js",
"test:watch": "yarn test -- --watch",
"webpack:dev": "yarn run webpack-dev-server -- --config webpack/webpack.dev.js --inline --hot --port=9060 --watch-content-base --env.stats=minimal",
"webpack:build:main": "yarn run webpack -- --config webpack/webpack.dev.js --env.stats=minimal",
"webpack:build": "yarn run cleanup && yarn run webpack:build:main",
"webpack:prod:main": "yarn run webpack --config webpack/webpack.prod.js --profile --verbose",
"webpack:prod": "yarn run cleanup && yarn run webpack:prod:main && yarn run clean-www",
"webpack:qa": "yarn run webpack -- --config webpack/webpack.qa.js --profile --env.stats=normal",
"webpack:test": "yarn run test",
"webpack-dev-server": "node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js",
"webpack": "node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js",
"postinstall": "node node_modules/phantomjs-prebuilt/install.js"
}

tsconfig.json:

{
"compilerOptions": {
"downlevelIteration": true,
"target": "es2015",
"module": "esnext",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false,
"skipLibCheck": true,
"suppressImplicitAnyIndexErrors": true,
"outDir": "target/www/app",
"lib": ["es7", "dom"],
"typeRoots": [
"node_modules/@types"
],
"baseUrl": "./",
"paths": {
"app/": ["src/main/webapp/app/"]
},
"importHelpers": true,
"allowJs": true
},
"files": [
"src/main/webapp/app/app.main.ts",
"src/main/webapp/app/polyfills.ts"
],
"include": [
"src/main/webapp/app",
"src/test/javascript/"
]
}

tsconfig-aot.json:

{
"compilerOptions": {
"target": "es5",
"module": "es2015",
"moduleResolution": "node",
"sourceMap": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false,
"suppressImplicitAnyIndexErrors": true,
"skipLibCheck": true,
"outDir": "target/www/app",
"lib": ["es7", "dom"],
"typeRoots": [
"node_modules/@types"
],
"baseUrl": "./",
"paths": {
"app/": ["src/main/webapp/app/"]
},
"importHelpers": true
},
"angularCompilerOptions": {
"genDir": "target/aot",
"skipMetadataEmit" : true,
"fullTemplateTypeCheck": false,
"strictTemplates": false,
"preserveWhitespaces": true
}
}

angular.json:

{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"defaultProjectItem": {
"root": "src/main",
"sourceRoot": "src/main/webapp/",
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"aot": false,
"outputPath": "target/www/app",
"index": "src/main/webapp//index.html",
"main": "src/main/webapp//app/app.main.ts",
"tsConfig": "src/main/webapp//../../../tsconfig.json",
"polyfills": "src/main/webapp//app/polyfills.ts",
"showCircularDependencies": false,
"assets": [
"src/main/webapp/content",
"src/main/webapp/i18n",
"src/main/webapp/favicon.ico"
],
"styles": [
"src/main/webapp/content/scss/vendor.scss",
"src/main/webapp/content/scss/global.scss",
"node_modules/primeicons/primeicons.css",
"node_modules/primeng/resources/themes/nova-light/theme.css",
"node_modules/primeng/resources/primeng.min.css",
"node_modules/quill/dist/quill.core.css",
"node_modules/quill/dist/quill.bubble.css",
"node_modules/quill/dist/quill.snow.css"
],
"scripts": [
"node_modules/quill/dist/quill.js"
]
},
"configurations": {
"prod": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"fileReplacements": [
{
"replace": "src/main/webapp/app/environments/environment.ts",
"with": "src/main/webapp/app/environments/environment.prod.ts"
}
]
},
"dev": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"fileReplacements": [
{
"replace": "src/main/webapp/app/environments/environment.ts",
"with": "src/main/webapp/app/environments/environment.dev.ts"
}
]
},
"qa": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"fileReplacements": [
{
"replace": "src/main/webapp/app/environments/environment.ts",
"with": "src/main/webapp/app/environments/environment.qa.ts"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "defaultProjectItem:build"
},
"configurations": {}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "defaultProjectItem:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/main/webapp//",
"karmaConfig": "src/test/javascript/karma.conf.js",
"polyfills": "src/main/webapp//app/polyfills.ts",
"scripts": [],
"styles": [
"src/main/webapp/content/scss/vendor.scss",
"src/main/webapp/content/scss/global.scss"
],
"assets": [
"src/main/webapp/content",
"src/main/webapp/i18n",
"src/main/webapp/favicon.ico"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"../../../tsconfig.json",
"../../../tsconfig-aot.json"
],
"exclude": []
}
}
}
}
},
"defaultProject": "defaultProjectItem",
"cli": {
"packageManager": "yarn"
},
"schematics": {
"@schematics/angular:component": {
"inlineStyle": true,
"inlineTemplate": false,
"skipTests": true,
"prefix": "jhi",
"styleExt": "scss"
},
"@schematics/angular:directive": {
"skipTests": true,
"prefix": "jhi"
},
"@schematics/angular:guard": {
"skipTests": true
},
"@schematics/angular:pipe": {
"skipTests": true
},
"@schematics/angular:service": {
"skipTests": true
}
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions