Module not found: Error: Can't resolve 'crypto' in ... Module not found: Error: Can't resolve 'stream' in ... Module not found: Error: Can't resolve 'fs' in ... Module not found: Error: Can't resolve 'os' in ...
1 2 3 4 5 6 7 8
[NG_SERVE] BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. [NG_SERVE] This is no longer the case. Verify if you need this module and configure a polyfill for it. [NG_SERVE] [NG_SERVE] If you want to include a polyfill, you need to: [NG_SERVE] - add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }' [NG_SERVE] - install 'stream-browserify' [NG_SERVE] If you don't want to include a polyfill, you can use an empty module like this: [NG_SERVE] resolve.fallback: { "stream": false }
polyfill.ts 파일에 내용을 추가하는 방법도 있지만 Webpack을 구성하여 해결하였습니다.
해결 방법
설치
사용자 지정 웹팩 구성을 하여 빌드 및 실행할 수 있도록 custom-webpack 패키지를 설치합니다.