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.
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:
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 thosenull
s. I’m guessing webpack needs to be stricter in this case.In my case it was this line:
I deleted the
./navigator
file but apparently webpack doesn’t check if the file exists, then reads it, getsnull
orundefined
, then feeds this non-existent value to the crypto hash generator and then explodes.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.
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?
I had the same problem. Upgrading node from 6.9.4 to 7.4.0 solved the problem for me.
Just hit the same problem here. Upgrading to Node 7.4.0 did not resolve the issue for me.
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:
The problems occurs when trying to export a file not present on the disk.
While import error show a clear error message:
The error during export does not help :
We have also the same error!!! With Version 2 from Webpack we have only problems!
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 fromnode_modules
, likereact-redux
.I had the same issue because of
instead of
I think the error wasn’t very clear but your comments help me.
Here is a workaround to help you to find the wrong import.
Let’s say you have some wrong import somewhere in your code:
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:
So you get this more explicit message:
Finally, search for ‘./missing-file’ string in your project to find which file contains the wrong import.
@Toub Someone give this guy a medal. Thank you Lord!
Freaking
@angular/cdk.
…
@thatisuday <https://github.com/thatisuday> @G-Pandey
<https://github.com/g-pandey> What have you done afterwards? I’m missing
cdk too. Am I supposed to install it manually?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4072 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFcnzQfH16IUQzt92moEoZVt22DJRBBFks5sM3YVgaJpZM4Lp5SW>
.
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
@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