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

Web pack build error with angular material #10791

Closed
smaldeniya opened this issue Jul 7, 2017 · 2 comments
Closed

Web pack build error with angular material #10791

smaldeniya opened this issue Jul 7, 2017 · 2 comments

Comments

@smaldeniya
Copy link

Actual Behavior:

  • When we try to build our code we got below exception
    ` 86% hashingHarmonyImportDependency {
    module: null,
    request: '@angular/cdk',
    userRequest: '@angular/cdk',
    range: [ 681, 1613 ],
    importedVar: 'WEBPACK_IMPORTED_MODULE_2__angular_cdk',
    loc:
    SourceLocation {
    start: Position { line: 10, column: 0 },
    end: Position { line: 10, column: 932 } } }
    crypto.js:74
    this._handle.update(data, encoding);
    ^

TypeError: Data must be a string or a buffer
at TypeError (native)
at Hash.update (crypto.js:74:16)
at HarmonyExportImportedSpecifierDependency.updateHash (/home/sahanm/Desktop/hmt_frontend/src/web-app/node_modules/webpack/lib/dependencies/HarmonyExportImportedSpecifierDependency.js:150:8)
at /home/sahanm/Desktop/hmt_frontend/src/web-app/node_modules/webpack/lib/DependenciesBlock.js:33:5
at Array.forEach (native)
at NormalModule.DependenciesBlock.updateHash (/home/sahanm/Desktop/hmt_frontend/src/web-app/node_modules/webpack/lib/DependenciesBlock.js:32:20)
at NormalModule.Module.updateHash (/home/sahanm/Desktop/hmt_frontend/src/web-app/node_modules/webpack/lib/Module.js:162:41)
at NormalModule.updateHash (/home/sahanm/Desktop/hmt_frontend/src/web-app/node_modules/webpack/lib/NormalModule.js:327:30)
at modules.forEach.m (/home/sahanm/Desktop/hmt_frontend/src/web-app/node_modules/webpack/lib/Chunk.js:253:31)
at Array.forEach (native)
at Chunk.updateHash (/home/sahanm/Desktop/hmt_frontend/src/web-app/node_modules/webpack/lib/Chunk.js:253:16)
at Compilation.createHash (/home/sahanm/Desktop/hmt_frontend/src/web-app/node_modules/webpack/lib/Compilation.js:1121:10)
at sealPart2 (/home/sahanm/Desktop/hmt_frontend/src/web-app/node_modules/webpack/lib/Compilation.js:605:9)
at next (/home/sahanm/Desktop/hmt_frontend/src/web-app/node_modules/tapable/lib/Tapable.js:138:11)
at Compilation. (/home/sahanm/Desktop/hmt_frontend/src/web-app/node_modules/webpack/lib/ProgressPlugin.js:110:5)
at Compilation.applyPluginsAsyncSeries (/home/sahanm/Desktop/hmt_frontend/src/web-app/node_modules/tapable/lib/Tapable.js:142:13)
`

after analyzing the code we found that @angular/cdk is only used by @angular/material and it was not installing as a peer dependancy when doing a npm install at root level of the project

As a work around we manually installed the @angular/cdk@2.0.0-beta.8 which is required by "@angular/material": "^2.0.0-beta.6" which is using by our code.

AngularJS Versions: *

  • @angular/cli: 1.0.3 node: 6.10.0 os: linux x64 @angular/animations: 4.2.5 @angular/common: 4.2.5 @angular/compiler: 4.2.5 @angular/compiler-cli: 4.2.5 @angular/core: 4.2.5 @angular/flex-layout: 2.0.0-beta.8 @angular/forms: 4.2.5 @angular/http: 4.2.5 @angular/material: 2.0.0-beta.8 @angular/platform-browser: 4.2.5 @angular/platform-browser-dynamic: 4.2.5 @angular/platform-server: 4.2.5 @angular/router: 4.2.5 @angular/cli: 1.0.3
  • @angular/material": "^2.0.0-beta.6

Additional Information:

  • Browser Type: Chrome
  • Browser Version: *
  • OS: ubuntu 16.04
  • Stack Traces:
@bseiller
Copy link

bseiller commented Jul 26, 2017

We see the same behaviour, but it seems to me this belongs to
angular-material2 => https://github.com/angular/material2
Also have a look here:
angular/components#5320
webpack/webpack#4072

@Splaktar
Copy link
Member

Please submit Angular Material questions here and issues here. This repo is for AngularJS Material.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants