window is not defined error with AOT
See original GitHub issueI’m submitting a … (check one with “x”)
[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter
Current behavior My goal is to set up AOT compilation in my Angular 4 application, which includes ngx-datatable. I am using the template from https://github.com/damienbod/AngularWebpackVisualStudio. “npm run webpack-production” gives me the following error:
ERROR in E:/MyApp/Sources/Web/node_modules/@swimlane/ngx-datatable/release/components/datatable.component.css:219 return window && document && document.all && !window.atob; ^ ReferenceError: window is not defined at E:/MyApp/Sources/Web/node_modules/@swimlane/ngx-datatable/release/components/datatable.component.css:219:9 at E:/MyApp/Sources/Web/node_modules/@swimlane/ngx-datatable/release/components/datatable.component.css:208:46 at module.exports (E:/MyApp/Sources/Web/node_modules/@swimlane/ngx-datatable/release/components/datatable.component.css:263:46) at Object.<anonymous> (E:/MyApp/Sources/Web/node_modules/@swimlane/ngx-datatable/release/components/datatable.component.css:81:36) at webpack_require (E:/MyApp/Sources/Web/node_modules/@swimlane/ngx-datatable/release/components/datatable.component.css:20:30) at E:/MyApp/Sources/Web/node_modules/@swimlane/ngx-datatable/release/components/datatable.component.css:63:18 at E:/MyApp/Sources/Web/node_modules/@swimlane/ngx-datatable/release/components/datatable.component.css:66:10 at ContextifyScript.Script.runInContext (vm.js:53:29) at WebpackResourceLoader._evaluate (E:\MyApp\Sources\Web\node_modules@ngtools\webpack\src\resource_loader.js:84:34) at _compile.then (E:\MyApp\Sources\Web\node_modules@ngtools\webpack\src\resource_loader.js:96:36)
Expected behavior No error
Reproduction of the problem Clone https://github.com/damienbod/AngularWebpackVisualStudio, add ngx-datatable to it, run “npm run webpack-production”
What is the motivation / use case for changing the behavior?
Please tell us about your environment: “dependencies”: { “@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.4.4”, “@angular/router”: “4.4.4”, “@swimlane/ngx-datatable”: “10.2.3”, “systemjs”: “0.20.19”, “types”: “0.1.1”, “zone.js”: “0.8.18” }, “devDependencies”: { “@ngtools/webpack”: “^1.7.1”, “@types/node”: “^8.0.28”, “@types/jasmine”: “^2.6.0”, “angular-router-loader”: “^0.6.0”, “angular2-template-loader”: “^0.6.2”, “awesome-typescript-loader”: “^3.2.2”, “clean-webpack-plugin”: “^0.1.16”, “codelyzer”: “^3.1.2”, “concurrently”: “^3.5.0”, “copy-webpack-plugin”: “4.1.0”, “css-loader”: “^0.28.4”, “file-loader”: “1.1.5”, “html-webpack-plugin”: “^2.30.1”, “jasmine-core”: “^2.7.0”, “jquery”: “^3.2.1”, “json-loader”: “^0.5.7”, “karma”: “^1.7.0”, “karma-chrome-launcher”: “^2.2.0”, “karma-jasmine”: “^1.1.0”, “karma-sourcemap-loader”: “^0.3.7”, “karma-spec-reporter”: “^0.0.31”, “karma-webpack”: “^2.0.4”, “node-sass”: “^4.5.3”, “raw-loader”: “^0.5.1”, “rimraf”: “^2.6.1”, “sass-loader”: “^6.0.6”, “source-map-loader”: “0.2.2”, “style-loader”: “0.19.0”, “tslint”: “^5.6.0”, “tslint-loader”: “^3.5.3”, “typescript”: “2.3.4”, “url-loader”: “0.6.2”, “webpack”: “^3.6.0”, “webpack-dev-server”: “2.9.1” },
-
Table version: 10.2.3
-
Angular version: 4.4.3
-
Browser: all
-
Language: TypeScript 2.3.4
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (1 by maintainers)
Top GitHub Comments
Same error with Angular 5 and V11.0.0 while AOT compilation Excluding node_modules also does not help
I am facing the same issue … I am currently using Angular 4.3.0 along with ngx-datatable 10.2.2