Webpack throwing TypeError: Data must be a string or a buffer in Angular CLI

Recently I got some error unexpectedly while running my Angular-CLI application.

By default you will not get any information about the error which WebPack is throwing. But I will tell you , how you can log the exact error related to your issue. The reason could be different for your scenario.

Navigate to yoursource\node_modules\webpack\lib\dependencies and open HarmonyExportImportedSpecifierDependency.js file and log the import dependency
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);
}

In my case I got the module in my application where the issue is.

Hope this helps

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s