1

Thing are working fine when I test in local IIS. But I get the following error while publish my angular project having angular material component.

node_modules/@angular/material/progress-spinner/typings/index.d.ts.MatProgressSpinner_Host.html (2,1): Property 'DOCUMENT' does not exist on type 'typeof "C:/Users/suresh.poudel/Desktop/FreshStart28th/SSO/SSOApp/node_modules/@angular/common/com...'. node_modules/@angular/material/progress-spinner/typings/index.d.ts.MatSpinner_Host.html (2,1): Property 'DOCUMENT' does not exist on .....\app.csproj The command "node node_modules/webpack/bin/webpack.js --env.prod" exited with code 2.

"devDependencies": {
    "@angular/animations": "~4.4.4",
    "@angular/cli": "^1.5.4",
    "@angular/common": "~4.4.4",
    "@angular/compiler": "~4.4.4",
    "@angular/core": "~4.4.4",
    "@angular/forms": "~4.4.4",
    "@angular/http": "~4.4.4",
    "@angular/platform-browser": "~4.4.4",
    "@angular/platform-browser-dynamic": "4.2.5",
    "@angular/platform-server": "4.2.5",
    "@angular/router": "4.2.5",
    "@ngtools/webpack": "1.5.0",
    "@types/chai": "4.0.1",
    "@types/jasmine": "2.5.53",
    "@types/webpack-env": "1.13.0",
    "angular2-router-loader": "0.3.5",
    "angular2-template-loader": "0.6.2",
    "aspnet-prerendering": "^3.0.1",
    "aspnet-webpack": "^2.0.1",
    "awesome-typescript-loader": "3.2.1",
    "bootstrap": "3.3.7",
    "chai": "4.0.2",
    "core-js": "^2.4.1",
    "css": "2.2.1",
    "css-loader": "0.28.4",
    "es6-shim": "0.35.3",
    "event-source-polyfill": "0.0.9",
    "expose-loader": "0.7.3",
    "extract-text-webpack-plugin": "2.1.2",
    "file-loader": "0.11.2",
    "html-loader": "0.4.5",
    "isomorphic-fetch": "2.2.1",
    "jasmine-core": "2.6.4",
    "jquery": "3.2.1",
    "json-loader": "0.5.4",
    "karma": "1.7.0",
    "karma-chai": "0.1.0",
    "karma-chrome-launcher": "2.2.0",
    "karma-cli": "1.0.1",
    "karma-jasmine": "1.1.0",
    "karma-webpack": "2.0.3",
    "preboot": "4.5.2",
    "raw-loader": "0.5.1",
    "reflect-metadata": "0.1.10",
    "rxjs": "^5.0.1",
    "style-loader": "0.18.2",
    "systemjs": "0.19.43",
    "to-string-loader": "1.1.5",
    "tsickle": "^0.23.5",
    "tslib": "^1.7.1",
    "typescript": "2.3.4",
    "url-loader": "0.5.9",
    "webpack": "2.5.1",
    "webpack-hot-middleware": "2.18.2",
    "webpack-merge": "4.1.0",
    "zone.js": "^0.8.12"
  },
  "dependencies": {
    "@angular/cdk": "^2.0.0-beta.12",
    "@angular/material": "2.0.0-beta.12"
  }
}

1 Answer 1

1

Have you tried running the command that is failing on the console?

C:\MySolutionPath> node node_modules/webpack/bin/webpack.js --env.prod

When I did this, it actually spit out a series of errors in my typescript and templates. The issue I found on my project was that my private properties couldn't be accessed by my templates. For example:

ERROR in quiz.component.html: Property 'auth' is private and only accessible within class 'QuizComponent'.
ERROR in quiz.component.html: Property 'auth' is private and only accessible within class 'QuizComponent'.

Reference: https://www.ryadel.com/en/the-command-node-node_modules-webpack-bin-webpack-js-env-prod-exited-with-code-2-error-fix-angular-node/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.