حل مشكلة Breaking webpack

 المشكلة:

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it.


الحل:

I had the same issue, this is the working solution i found on git hub. https://github.com/ChainSafe/web3.js/issues/4070

run in your project directory:

npm install crypto-browserify stream-browserify assert stream-http https-browserify os-browserify

tsconfig.json Add this in:"compilerOptions": { [...] }

"paths" : {
      "crypto": ["./node_modules/crypto-browserify"],
      "stream": ["./node_modules/stream-browserify"],
      "assert": ["./node_modules/assert"],
      "http": ["./node_modules/stream-http"],
      "https": ["./node_modules/https-browserify"],
      "os": ["./node_modules/os-browserify"],
    }

المرجع:
https://stackoverflow.com/questions/67572355/webpack-5-angular-polyfill-for-node-js-crypto-js

تعليقات

المشاركات الشائعة من هذه المدونة

ngx-extended-pdf-viewer

how to getting access token for https://fcm.googleapis.com/v1/projects/al-ayahya-co/messages:send for angular and backend nestjs

طريقة تفعيل زر Inline Keyboard في Telegram Bot