Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Data must be a string or a buffer #4072

Closed
catamphetamine opened this issue Jan 21, 2017 · 91 comments

Comments

Projects
None yet
@catamphetamine
Copy link

commented Jan 21, 2017

Using the latest 2.2.0 release, although the error was on rc.4 before I updated too.

crypto.js:73
  this._handle.update(data, encoding);
               ^

TypeError: Data must be a string or a buffer
    at TypeError (native)
    at Hash.update (crypto.js:73:16)
    at HarmonyExportImportedSpecifierDependency.updateHash (/Users/kuchumovn/work/webapp/frontend/node_modules/webpack/lib/dependencies/HarmonyExportImportedSpecifierDependency.js:144:8)
    at /Users/kuchumovn/work/webapp/frontend/node_modules/webpack/lib/DependenciesBlock.js:33:5
    at Array.forEach (native)
    at NormalModule.DependenciesBlock.updateHash (/Users/kuchumovn/work/webapp/frontend/node_modules/webpack/lib/DependenciesBlock.js:32:20)
    at NormalModule.Module.updateHash (/Users/kuchumovn/work/webapp/frontend/node_modules/webpack/lib/Module.js:162:41)
    at NormalModule.updateHash (/Users/kuchumovn/work/webapp/frontend/node_modules/webpack/lib/NormalModule.js:327:30)
    at modules.forEach.m (/Users/kuchumovn/work/webapp/frontend/node_modules/webpack/lib/Chunk.js:253:31)
    at Array.forEach (native)

I supposse it's computing a hash for a file, and a file is empty (?) or non-existent or something like that.
Anyway no clue on the real error in this error message.

@rguanghui

This comment has been minimized.

Copy link

commented Jan 21, 2017

the same error with me.

@bebraw

This comment has been minimized.

Copy link
Member

commented Jan 21, 2017

Can you provide a small project showing the error? The issue could be debugged that way.

@rguanghui

This comment has been minimized.

Copy link

commented Jan 21, 2017

@bebraw

https://github.com/rguanghui/webpack-updatehash-error

this is the project to debug. hope useful :)

node version: 6.0.0
system: mac OS Sierra 10.12.2

by the way, this error comes after i update my system ( from 10.12.1 to 10.12.2 )

@bebraw

This comment has been minimized.

Copy link
Member

commented Jan 21, 2017

Looks like this is a null issue. That's why it errors like that. I wonder if it should fail earlier, though.

I did the following change:

diff --git a/src/shopview/index.js b/src/shopview/index.js
index 505c1b1..f9c5046 100644
--- a/src/shopview/index.js
+++ b/src/shopview/index.js
@@ -3,5 +3,5 @@ import ShopRate from './shopinfo/shoprate'
 // import ShopInfo from './shopinfo/shopinfo'
 // import ShopHeader from './shopheader/shopheader'
 
-export { ShopHeader, ShopRate, ShopInfo, ShopView }
+//export { ShopRate, ShopView }
 export default ShopView

This made the error disappear (gives another error, but that's perhaps expected). That earlier export referred to code that doesn't exist so that might explain those nulls. I'm guessing webpack needs to be stricter in this case.

@catamphetamine

This comment has been minimized.

Copy link
Author

commented Jan 21, 2017

In my case it was this line:

export { default as navigator }      from './navigator'

I deleted the ./navigator file but apparently webpack doesn't check if the file exists, then reads it, gets null or undefined, then feeds this non-existent value to the crypto hash generator and then explodes.

@bebraw bebraw added the P1: Urgent label Jan 21, 2017

@bebraw

This comment has been minimized.

Copy link
Member

commented Jan 21, 2017

Yup. It's missing a check. Or even if it skips an explicit check, it should fail in a way that allows the user to fix the problem.

@sokra

This comment has been minimized.

Copy link
Member

commented Jan 23, 2017

It should do a check for dep.module and emit a webpack missing module error code. Somebody wants to do a PR? See other Dependencies for example i. e. CommonJsRequireDependency

@sasha240100

This comment has been minimized.

Copy link

commented Jan 26, 2017

@bebraw @sokra Got the same error today:

image

webpack version: 2.2.0
webpack-dev-server version: 2.2.0

@pllearns

This comment has been minimized.

Copy link

commented Jan 27, 2017

Hi @sokra, I was looking into this to see if I could submit a PR, but I wanted to verify this current dep.module check in the HarmonyImportDependency.js could I emit an error module code from here? if(!dep.module) { const stringifiedError = JSON.stringify(`Cannot find module "${dep.request}"`); return `throw new Error(${stringifiedError});${newline}`; }

@ngocketit

This comment has been minimized.

Copy link

commented Jan 29, 2017

I got the same error after making a bunch of changes to the code and now it's very hard to pinpoint exactly what change is causing the issue. Is there any way to know what file/module is making trouble?

@dougrday

This comment has been minimized.

Copy link

commented Jan 31, 2017

Anyone else having this issue while transpiling from Typescript to Babel to ES5?

I believe I resolved the issue by changing jsx from preserve to react in my tsconfig.json:

image

@stormaaja

This comment has been minimized.

Copy link

commented Feb 1, 2017

I had the same problem. Upgrading node from 6.9.4 to 7.4.0 solved the problem for me.

@lincolnthree

This comment has been minimized.

Copy link

commented Feb 1, 2017

Just hit the same problem here. Upgrading to Node 7.4.0 did not resolve the issue for me.

@l0rda

This comment has been minimized.

Copy link

commented Feb 2, 2017

Same problem.

Darwin 16.4.0 (Sierra 10.2.3)
node v7.5.0
npm v4.1.2

@karolmie1

This comment has been minimized.

Copy link

commented Feb 3, 2017

I get that problem when I try to reexport not existing class from file, for example
export { ManageUsersComponent } from './manage-users.component';
when ManageUsersComponent does not exist.

I get it, its a problem with code, but I would appreciate better error message instead of:

86% hashingTypeError: Data must be a string or a buffer
    at Hash.update (crypto.js:74:16)
    at HarmonyExportImportedSpecifierDependency.updateHash .../node_modules/webpack/lib/dependencies/HarmonyExportImportedSpecifierDependency.js:144:8)
    at .../node_modules/webpack/lib/DependenciesBlock.js:33:5
    at Array.forEach (native)
@Toub

This comment has been minimized.

Copy link

commented Feb 3, 2017

The problems occurs when trying to export a file not present on the disk.
While import error show a clear error message:

import { MissingFile } from './MissingFile';
ERROR in /app/src/app/components/somecomponent/index.ts (6,29): Cannot find module './MissingFile'.)
webpack: Failed to compile.

The error during export does not help :

export { MissingFile } from './MissingFile';
webpack: Compiling...
 86% hashingcrypto.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 (/app/node_modules/webpack/lib/dependencies/HarmonyExportImportedSpecifierDependency.js:144:8)
    at /app/node_modules/webpack/lib/DependenciesBlock.js:33:5
    at Array.forEach (native)
    at NormalModule.DependenciesBlock.updateHash (/app/node_modules/webpack/lib/DependenciesBlock.js:32:20)
    at NormalModule.Module.updateHash (/app/node_modules/webpack/lib/Module.js:162:41)
    at NormalModule.updateHash (/app/node_modules/webpack/lib/NormalModule.js:327:30)
    at modules.forEach.m (/app/node_modules/webpack/lib/Chunk.js:253:31)
    at Array.forEach (native)
    at Chunk.updateHash (/app/node_modules/webpack/lib/Chunk.js:253:16)
    at Compilation.createHash (/app/node_modules/webpack/lib/Compilation.js:989:10)
    at sealPart2 (/app/node_modules/webpack/lib/Compilation.js:580:9)
    at next (/app/node_modules/tapable/lib/Tapable.js:138:11)
    at Compilation.<anonymous> (/app/node_modules/webpack/lib/ProgressPlugin.js:110:5)
    at next (/app/node_modules/tapable/lib/Tapable.js:140:14)
    at ExtractTextPlugin.<anonymous> (/app/node_modules/extract-text-webpack-plugin/index.js:297:5)
    at /app/node_modules/async/dist/async.js:356:16
    at iteratorCallback (/app/node_modules/async/dist/async.js:936:13)
    at /app/node_modules/async/dist/async.js:840:16
    at /app/node_modules/extract-text-webpack-plugin/index.js:281:6
    at /app/node_modules/async/dist/async.js:356:16
    at iteratorCallback (/app/node_modules/async/dist/async.js:936:13)
    at /app/node_modules/async/dist/async.js:840:16
    at /app/node_modules/extract-text-webpack-plugin/index.js:278:13
    at /app/node_modules/async/dist/async.js:3025:16
    at eachOfArrayLike (/app/node_modules/async/dist/async.js:941:9)
    at eachOf (/app/node_modules/async/dist/async.js:991:5)
    at Object.eachLimit (/app/node_modules/async/dist/async.js:3089:3)
    at /app/node_modules/extract-text-webpack-plugin/index.js:252:11
    at /app/node_modules/async/dist/async.js:3025:16
    at eachOfArrayLike (/app/node_modules/async/dist/async.js:941:9)
    at eachOf (/app/node_modules/async/dist/async.js:991:5)
    at Object.eachLimit (/app/node_modules/async/dist/async.js:3089:3)
    at ExtractTextPlugin.<anonymous> (/app/node_modules/extract-text-webpack-plugin/index.js:249:10)
    at Compilation.applyPluginsAsyncSeries (/app/node_modules/tapable/lib/Tapable.js:142:13)
    at Compilation.seal (/app/node_modules/webpack/lib/Compilation.js:545:8)
    at /app/node_modules/webpack/lib/Compiler.js:474:16
    at /app/node_modules/tapable/lib/Tapable.js:225:11
    at _addModuleChain (/app/node_modules/webpack/lib/Compilation.js:452:11)
    at processModuleDependencies.err (/app/node_modules/webpack/lib/Compilation.js:423:13)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
@ghost

This comment has been minimized.

Copy link

commented Feb 6, 2017

Do we have a resolution on this issue? I'm getting the same error and I have no idea what export/import statement(s) are causing this problem.

@j-nord

This comment has been minimized.

Copy link

commented Feb 7, 2017

We have also the same error!!! With Version 2 from Webpack we have only problems!

@simonbuchan

This comment has been minimized.

Copy link

commented Feb 8, 2017

Another case to watch out for is if you override resolve.extensions to not include .js (because I don't have any javascript!) and are importing an es2015 module supporting package from node_modules, like react-redux.

@kopax

This comment has been minimized.

Copy link

commented Feb 9, 2017

I had the same issue because of

export { default } from 'Progress';
exportdefault as ProgressBar } from 'ProgressBar';

instead of

export { default } from './Progress';
exportdefault as ProgressBar } from './ProgressBar';

I think the error wasn't very clear but your comments help me.

@Toub

This comment has been minimized.

Copy link

commented Feb 9, 2017

Here is a workaround to help you to find the wrong import.

Let's say you have some wrong import somewhere in your code:

export { Some } from './missing-file';

You can improve the error message by manually editing the following file: node_modules/webpack/lib/dependencies/HarmonyExportImportedSpecifierDependency.js and insert some log at line 144:

   updateHash(hash) {
      super.updateHash(hash);
      const hashValue = this.getHashValue(this.importDependency.module);

      if (this.importDependency.module != null){
         // console.log('Module resource: ', this.importDependency.module.resource);
      }else{
         console.log('\nFile not found: ', this.importDependency);
      }

      hash.update(hashValue);
   }

So you get this more explicit message:

 86% hashing                                                                               
File not found:  HarmonyImportDependency {
  module: null,
  request: './missing-file',
  userRequest: './missing-file',
  range: [ 562, 600 ],
  importedVar: '__WEBPACK_IMPORTED_MODULE_8__missing_file__',
  loc: SourceLocation { index: -1 } }
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 (/app/node_modules/webpack/lib/dependencies/HarmonyExportImportedSpecifierDependency.js:149:6)

Finally, search for './missing-file' string in your project to find which file contains the wrong import.

@bihe

This comment has been minimized.

Copy link

commented Feb 9, 2017

Thx @Toub - saved me!

@thatisuday

This comment has been minimized.

Copy link

commented Jul 10, 2017

@angular/cdk was missing on my case.

@G-Pandey

This comment has been minimized.

Copy link

commented Jul 10, 2017

@Toub Someone give this guy a medal. Thank you Lord!
Freaking @angular/cdk.

@OddDev

This comment has been minimized.

Copy link

commented Jul 11, 2017

@thatisuday @G-Pandey What have you done afterwards? I'm missing cdk too. Am I supposed to install it manually?

@thatisuday

This comment has been minimized.

Copy link

commented Jul 11, 2017

@rgantla

This comment has been minimized.

Copy link

commented Jul 13, 2017

for anyone using angular material2 in their project, here's the fix:

npm install --@angular/cdk --save

this is because material 2 now uses cdk as a dependency. CDK is the short form of component dev kit. This signifies that these are general-purpose tools for building components that are not coupled to Material Design

Ref: https://github.com/angular/material2/blob/master/guides/getting-started.md#step-1-install-angular-material-and-angular-cdk

@robbierao123

This comment has been minimized.

Copy link

commented Jul 14, 2017

my missing file is "angular/cdk". and there's 2600+ file have imported this.. idk wut to do

@rgantla

This comment has been minimized.

Copy link

commented Jul 14, 2017

Please ignore my above comment.

for anyone using angular material2 in their project, here's the fix:

npm install -- --save @angular/cdk

this is because material 2 now uses cdk as a dependency. CDK is the short form of component dev kit. This signifies that these are general-purpose tools for building components that are not coupled to Material Design

Ref: https://github.com/angular/material2/blob/master/guides/getting-started.md#step-1-install-angular-material-and-angular-cdk

@shinde-prasad

This comment has been minimized.

Copy link

commented Jul 18, 2017

Yes. Install "@angular/CDK"
@Toub thanks.

@luckylooke

This comment has been minimized.

Copy link

commented Jul 25, 2017

For me it was exporting member from uninstalled node module.. but nothing in error even in node debug log pointed me to the problem. It was just reading this thread for hints and analysing git log history.

I see that it should be fixed by this merge: #4368
But I dont know how to find out the release version containing that merge.

I am using webpack v2.6.1, I dont want to risk changing major version due to project stage. Thanks ;)

@RichardSilveira

This comment has been minimized.

Copy link

commented Aug 3, 2017

I had its same issue in an Angular project and i added on devDependencies the package "ngtools/webpack":"1.4.0". (we have increased the version wich angular choose to install as his dependency) and this generic erros gone away and the project import/exports erros was shown

@stephenad

This comment has been minimized.

Copy link

commented Aug 15, 2017

@Toub

I tried your debugging code but get nothing back below is the error and my edit to the file you specified

`** NG Live Development Server is running on http://localhost:4200. **
86% hashingcrypto.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 (C:\wamp\www\nationalgrid\public_cli\node_modules\angular-cli\node_modules\webpack\lib\dependencies\HarmonyExportImportedSpecifierD
ependency.js:144:8)
at C:\wamp\www\nationalgrid\public_cli\node_modules\angular-cli\node_modules\webpack\lib\DependenciesBlock.js:33:5
at Array.forEach (native)
at NormalModule.DependenciesBlock.updateHash (C:\wamp\www\nationalgrid\public_cli\node_modules\angular-cli\node_modules\webpack\lib\DependenciesBlock.js:32:20)
at NormalModule.Module.updateHash (C:\wamp\www\nationalgrid\public_cli\node_modules\angular-cli\node_modules\webpack\lib\Module.js:162:41)
at NormalModule.updateHash (C:\wamp\www\nationalgrid\public_cli\node_modules\angular-cli\node_modules\webpack\lib\NormalModule.js:327:30)
at modules.forEach.m (C:\wamp\www\nationalgrid\public_cli\node_modules\angular-cli\node_modules\webpack\lib\Chunk.js:253:31)
at Array.forEach (native)
at Chunk.updateHash (C:\wamp\www\nationalgrid\public_cli\node_modules\angular-cli\node_modules\webpack\lib\Chunk.js:253:16)
at Compilation.createHash (C:\wamp\www\nationalgrid\public_cli\node_modules\angular-cli\node_modules\webpack\lib\Compilation.js:989:10)
at sealPart2 (C:\wamp\www\nationalgrid\public_cli\node_modules\angular-cli\node_modules\webpack\lib\Compilation.js:580:9)
at next (C:\wamp\www\nationalgrid\public_cli\node_modules\tapable\lib\Tapable.js:202:11)
at Compilation. (C:\wamp\www\nationalgrid\public_cli\node_modules\angular-cli\node_modules\webpack\lib\ProgressPlugin.js:110:5)
at next (C:\wamp\www\nationalgrid\public_cli\node_modules\tapable\lib\Tapable.js:204:14)
at ExtractTextPlugin. (C:\wamp\www\nationalgrid\public_cli\node_modules\extract-text-webpack-plugin\index.js:317:5)
at C:\wamp\www\nationalgrid\public_cli\node_modules\extract-text-webpack-plugin\node_modules\async\dist\async.js:421:16
at iteratorCallback (C:\wamp\www\nationalgrid\public_cli\node_modules\extract-text-webpack-plugin\node_modules\async\dist\async.js:998:13)
at C:\wamp\www\nationalgrid\public_cli\node_modules\extract-text-webpack-plugin\node_modules\async\dist\async.js:906:16
at C:\wamp\www\nationalgrid\public_cli\node_modules\extract-text-webpack-plugin\index.js:301:6
at C:\wamp\www\nationalgrid\public_cli\node_modules\extract-text-webpack-plugin\node_modules\async\dist\async.js:421:16
at iteratorCallback (C:\wamp\www\nationalgrid\public_cli\node_modules\extract-text-webpack-plugin\node_modules\async\dist\async.js:998:13)
at C:\wamp\www\nationalgrid\public_cli\node_modules\extract-text-webpack-plugin\node_modules\async\dist\async.js:906:16
at C:\wamp\www\nationalgrid\public_cli\node_modules\extract-text-webpack-plugin\index.js:298:13
at C:\wamp\www\nationalgrid\public_cli\node_modules\extract-text-webpack-plugin\node_modules\async\dist\async.js:3083:16
at eachOfArrayLike (C:\wamp\www\nationalgrid\public_cli\node_modules\extract-text-webpack-plugin\node_modules\async\dist\async.js:1003:9)
at eachOf (C:\wamp\www\nationalgrid\public_cli\node_modules\extract-text-webpack-plugin\node_modules\async\dist\async.js:1051:5)
at Object.eachLimit (C:\wamp\www\nationalgrid\public_cli\node_modules\extract-text-webpack-plugin\node_modules\async\dist\async.js:3145:5)
at C:\wamp\www\nationalgrid\public_cli\node_modules\extract-text-webpack-plugin\index.js:271:11
at C:\wamp\www\nationalgrid\public_cli\node_modules\extract-text-webpack-plugin\node_modules\async\dist\async.js:3083:16
at eachOfArrayLike (C:\wamp\www\nationalgrid\public_cli\node_modules\extract-text-webpack-plugin\node_modules\async\dist\async.js:1003:9)
at eachOf (C:\wamp\www\nationalgrid\public_cli\node_modules\extract-text-webpack-plugin\node_modules\async\dist\async.js:1051:5)
at Object.eachLimit (C:\wamp\www\nationalgrid\public_cli\node_modules\extract-text-webpack-plugin\node_modules\async\dist\async.js:3145:5)
at ExtractTextPlugin. (C:\wamp\www\nationalgrid\public_cli\node_modules\extract-text-webpack-plugin\index.js:268:10)
at Compilation.applyPluginsAsyncSeries (C:\wamp\www\nationalgrid\public_cli\node_modules\tapable\lib\Tapable.js:206:13)
at Compilation.seal (C:\wamp\www\nationalgrid\public_cli\node_modules\angular-cli\node_modules\webpack\lib\Compilation.js:545:8)
at C:\wamp\www\nationalgrid\public_cli\node_modules\angular-cli\node_modules\webpack\lib\Compiler.js:474:16
at C:\wamp\www\nationalgrid\public_cli\node_modules\tapable\lib\Tapable.js:289:11
at _addModuleChain (C:\wamp\www\nationalgrid\public_cli\node_modules\angular-cli\node_modules\webpack\lib\Compilation.js:452:11)
at processModuleDependencies.err (C:\wamp\www\nationalgrid\public_cli\node_modules\angular-cli\node_modules\webpack\lib\Compilation.js:423:13)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)`

updateHash(hash) { super.updateHash(hash); const hashValue = this.getHashValue(this.importDependency.module); if (this.importDependency.module != null){ // console.log('Module resource: ', this.importDependency.module.resource); }else{ console.log('\nFile not found: ', this.importDependency); } hash.update(hashValue); }

@Toub

This comment has been minimized.

Copy link

commented Aug 15, 2017

@stephenad are you sure to edit the right file?

Your stack trace is still at line 144, so you probably edited an other version of this file.

Try again with C:\wamp\www\nationalgrid\public_cli\node_modules\angular-cli\node_modules\webpack\lib\dependencies\HarmonyExportImportedSpecifierDependency.js

@coderaayush

This comment has been minimized.

Copy link

commented Aug 17, 2017

Received the same error due to some package update, can't specify exactly which one caused it but I resolved it by removing all node modules packages and a little tweaking up with the versions of @angular modules. Try to use these package versions (you may remove the unnecessary one's)

"devDependencies": {
    "@angular/cli": "^1.3.0",
    "@angular/common": "^4.0.0",
    "@angular/compiler": "^4.0.0",
    "@angular/core": "^4.0.0",
    "@angular/forms": "^4.0.0",
    "@angular/http": "^4.0.0",
    "@angular/platform-browser": "^4.0.0",
    "@angular/platform-browser-dynamic": "^4.0.0",
    "@angular/router": "^4.0.0",
    "@types/node": "^6.0.73",
    "core-js": "^2.4.1",
    "eslint": "3.19.0",
    "eslint-config-google": "0.7.1",
    "node-sass": "^4.5.3",
    "rollup": "^0.41.6",
    "rollup-plugin-commonjs": "^8.0.2",
    "rollup-plugin-node-resolve": "^3.0.0",
    "rollup-plugin-uglify": "^1.0.2",
    "rxjs": "^5.1.0",
    "zone.js": "^0.8.14"
  },
  "directories": {
    "test": "test"
  },
  "dependencies": {
    "@angular/animations": "^5.0.0-beta.4",
    "@angular/cdk": "^2.0.0-beta.8",
    "@angular/common": "^5.0.0-beta.4",
    "@angular/compiler": "^5.0.0-beta.4",
    "@angular/compiler-cli": "^4.1.2",
    "@angular/core": "^5.0.0-beta.4",
    "@angular/forms": "^5.0.0-beta.4",
    "@angular/http": "^5.0.0-beta.4",
    "@angular/material": "^2.0.0-beta.8",
    "@angular/platform-browser": "^5.0.0-beta.4",
    "@angular/platform-browser-dynamic": "^5.0.0-beta.4",
    "@angular/platform-server": "^5.0.0-beta.4",
    "@angular/router": "^5.0.0-beta.4",
    "@ng-bootstrap/ng-bootstrap": "^1.0.0-beta.1",
    "@types/jasmine": "2.5.38",
    "@types/lodash": "^4.14.64",
    "@types/node": "^6.0.73",
    "angular-material": "^1.1.4",
    "b": "^2.0.1",
    "body-parser": "1.17.1",
    "bootstrap": "^4.0.0-alpha.6",
    "codelyzer": "~2.0.0",
    "cookie-parser": "1.4.3",
    "ejs": "2.5.6",
    "eslint": "3.19.0",
    "eslint-config-google": "0.7.1",
    "express": "4.15.2",
    "express-session": "1.15.3",
    "express-validator": "3.2.0",
    "font-awesome": "^4.7.0",
    "jasmine-core": "~2.5.2",
    "jasmine-spec-reporter": "~3.2.0",
    "jquery": "^3.2.1",
    "jsonwebtoken": "7.4.1",
    "karma": "~1.4.1",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^0.2.0",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "mongoose": "4.10.1",
    "morgan": "1.8.1",
    "multer": "^1.3.0",
    "passport": "0.3.2",
    "passport-jwt": "2.2.1",
    "passport-local": "1.0.0",
    "protractor": "~5.1.0",
    "stylus": "0.54.5",
    "temp": "0.8.3",
    "ts-node": "~2.0.0",
    "tslint": "~4.5.0",
    "typescript": "^2.4.2",
    "uuid": "3.0.1",
    "winston": "2.3.1"
  }
@jose2007kj

This comment has been minimized.

Copy link

commented Sep 24, 2017

thanks @Toub

@AndrewRayCode

This comment has been minimized.

Copy link

commented Oct 22, 2017

My stack trace was happening because I was using the DllReferencePlugin, and hadn't upgraded my dll webpack config file and re-ran it.

@jaquan1227

This comment has been minimized.

Copy link

commented Nov 3, 2017

in my case, after check, it was null.

@uncledb

This comment has been minimized.

Copy link

commented Jan 28, 2018

@AndrewRayCode yeah, same with you,Thank you

@davidpelayo davidpelayo referenced this issue Apr 5, 2018

Closed

Unexpected error from object-hash #1234

1 of 3 tasks complete
@Puvipavan

This comment has been minimized.

Copy link

commented May 29, 2018

var word = "s3cr3t";
crypto.createHash('sha256').update(word.toString()).digest('base64').toString();

@stupidprog

This comment has been minimized.

Copy link

commented Feb 26, 2019

@Toub there's no importDependency in my HarmonyExportImportedSpecifierDependency.js :(

updateHash(hash) { super.updateHash(hash); const hashValue = this.getHashValue(this.module); hash.update(hashValue); }

@Toub

This comment has been minimized.

Copy link

commented Feb 26, 2019

@stupidprog my workaround was for webpack 2.2.0, so I guess you are using a more recent version

@stupidprog

This comment has been minimized.

Copy link

commented Feb 26, 2019

yes webpack 4 so how i solve this ? :( @Toub

88% hashinginternal/crypto/hash.js:58
    throw new ERR_INVALID_ARG_TYPE('data',
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be one of type string, TypedArray, or DataView. Received type undefined
    at Hash.update (internal/crypto/hash.js:58:11)
    at BulkUpdateDecorator.update (C:\Users\Intan\AppData\Roaming\npm\node_modules\webpack\lib\util\createHash.js:35:14)
    at CssModule.updateHash (D:\Intan\workspace\belisada-seller\node_modules\mini-css-extract-plugin\dist\index.js:105:10)
    at Compilation.createHash (C:\Users\Intan\AppData\Roaming\npm\node_modules\webpack\lib\Compilation.js:2296:11)
    at hooks.optimizeTree.callAsync.err (C:\Users\Intan\AppData\Roaming\npm\node_modules\webpack\lib\Compilation.js:1288:9)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Users\Intan\AppData\Roaming\npm\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:32:10), <anonymous>:9:1)
    at AsyncSeriesHook.lazyCompileHook (C:\Users\Intan\AppData\Roaming\npm\node_modules\webpack\node_modules\tapable\lib\Hook.js:154:20)
    at Compilation.seal (C:\Users\Intan\AppData\Roaming\npm\node_modules\webpack\lib\Compilation.js:1244:27)
    at hooks.make.callAsync.err (C:\Users\Intan\AppData\Roaming\npm\node_modules\webpack\lib\Compiler.js:624:17)
    at _done (eval at create (C:\Users\Intan\AppData\Roaming\npm\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:32:10), <anonymous>:9:1)
    at _err2 (eval at create (C:\Users\Intan\AppData\Roaming\npm\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:32:10), <anonymous>:44:22)
    at _addModuleChain (C:\Users\Intan\AppData\Roaming\npm\node_modules\webpack\lib\Compilation.js:1095:12)
    at processModuleDependencies.err (C:\Users\Intan\AppData\Roaming\npm\node_modules\webpack\lib\Compilation.js:1007:9)
    at process._tickCallback (internal/process/next_tick.js:61:11)
@Toub

This comment has been minimized.

Copy link

commented Feb 26, 2019

Sorry I am not a webpack expert, please open a ticket on Stackoverflow.

@dmitriyK1

This comment has been minimized.

Copy link

commented Apr 17, 2019

In my case it was some problem with yarn.lock, I deleted it and run yarn and problem was gone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.