atularen / ngx-monaco-editor

Monaco Editor component for Angular 2 and Above
https://www.npmjs.com/package/ngx-monaco-editor
MIT License
428 stars 155 forks source link

Editor works in ng-serve/development mode but fails in production #65

Closed casovita closed 6 years ago

casovita commented 6 years ago

package.json:

{
  "name": "lynx-backoffice",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve --proxy-config proxy.conf.json",
    "build": "ng build",
    "buildprod": "ng build --prod --base-href /ClientApp/dist/",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^5.0.0",
    "@angular/common": "^5.0.0",
    "@angular/compiler": "^5.0.0",
    "@angular/core": "^5.0.0",
    "@angular/forms": "^5.0.0",
    "@angular/http": "^5.0.0",
    "@angular/platform-browser": "^5.0.0",
    "@angular/platform-browser-dynamic": "^5.0.0",
    "@angular/router": "^5.0.0",
    "angular-tree-component": "^7.0.1",
    "angular2-bootstrap-switch": "^0.2.3",
    "bootstrap": "3.3.5",
    "core-js": "^2.4.1",
    "css-loader": "^0.28.7",
    "jquery": "^1.12.4",
    "less": "^2.7.2",
    "less-loader": "^4.0.5",
    "ng-block-ui": "^1.0.0-beta.16",
    "ng-selectize": "^1.1.0",
    "ng2-bootstrap-modal": "^1.0.1",
    "ng2-date-picker": "^2.7.4",
    "ng2-dnd": "^4.2.0",
    "ng2-toastr": "^4.1.2",
    "ngx-monaco-editor": "^5.0.0",
    "ngx-pagination": "^3.1.0",
    "ngx-simple-modal": "^1.3.8",
    "rxjs": "^5.5.2",
    "selectize": "^0.12.4",
    "zone.js": "^0.8.14"
  },
  "devDependencies": {
    "@angular/cli": "^1.5.4",
    "@angular/compiler-cli": "^5.0.0",
    "@angular/language-service": "^5.0.0",
    "@types/jasmine": "~2.5.53",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "~3.2.0",
    "jasmine-core": "~2.6.2",
    "jasmine-spec-reporter": "~4.1.0",
    "karma": "~1.7.0",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "ts-node": "~3.2.0",
    "tslint": "~5.3.2",
    "typescript": "~2.4.2"
  }
}

angular.cli.json "assets": [ "assets", "favicon.ico", { "glob": "*/", "input": "../node_modules/ngx-monaco-editor/assets/monaco", "output": "./assets/monaco/" } ],

template: image

Error in production: image

laxmikanta415 commented 6 years ago

i am facing the same problem.

yowari commented 6 years ago

Try to set the baseUrl to correspond to --base-href in the module configuration https://github.com/atularen/ngx-monaco-editor#configurations

casovita commented 6 years ago

Thank you @yowari, very helpful. Work's for me!